Make includeDocs private

This commit is contained in:
adrinr 2023-03-15 20:02:48 +01:00
parent 6c6d060550
commit 06245fee98
1 changed files with 9 additions and 4 deletions

View File

@ -52,7 +52,7 @@ export class QueryBuilder<T> {
bookmark?: string bookmark?: string
sortOrder: string sortOrder: string
sortType: string sortType: string
includeDocs: boolean #includeDocs: boolean
version?: string version?: string
indexBuilder?: () => Promise<any> indexBuilder?: () => Promise<any>
noEscaping = false noEscaping = false
@ -78,7 +78,7 @@ export class QueryBuilder<T> {
this.limit = 50 this.limit = 50
this.sortOrder = "ascending" this.sortOrder = "ascending"
this.sortType = "string" this.sortType = "string"
this.includeDocs = true this.#includeDocs = true
} }
disableEscaping() { disableEscaping() {
@ -139,7 +139,12 @@ export class QueryBuilder<T> {
} }
excludeDocs() { excludeDocs() {
this.includeDocs = false this.#includeDocs = false
return this
}
includeDocs() {
this.#includeDocs = true
return this return this
} }
@ -449,7 +454,7 @@ export class QueryBuilder<T> {
let body: any = { let body: any = {
q: this.buildSearchQuery(), q: this.buildSearchQuery(),
limit: Math.min(this.limit, 200), limit: Math.min(this.limit, 200),
include_docs: this.includeDocs, include_docs: this.#includeDocs,
} }
if (this.bookmark) { if (this.bookmark) {
body.bookmark = this.bookmark body.bookmark = this.bookmark