Class Query

Index

Properties

Methods

Properties

public static use$geoWithin: boolean

Methods

public $where(argument: string): Query

Parameters

  • argument: string

Returns

Query

public $where(argument: Function): Query

Parameters

  • argument: Function

Returns

Query

public all(val: number): Query

Parameters

  • val: number

Returns

Query

public all(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public and(array: Array<Object>): Query

Parameters

  • array: Array<Object>

Returns

Query

public batchSize(val: number): Query

Parameters

  • val: number

Returns

Query

public box(val: Object): Query

Parameters

  • val: Object

Returns

Query

public box(a: Array<number>, b: Array<number>): Query

Parameters

  • a: Array<number>
  • b: Array<number>

Returns

Query

public cast(model: Model, obj: Object): U

Parameters

  • model: Model
  • obj: Object

Returns

U

public circle(area: Object): Query

Parameters

  • area: Object

Returns

Query

public circle(path: string, area: Object): Query

Parameters

  • path: string
  • area: Object

Returns

Query

public comment(val: any): Query

Parameters

  • val: any

Returns

Query

public count(callback?: (err: any, count: number) => void): Query

Parameters

  • callback?: (err: any, count: number) => void optional

Returns

Query

public count(criteria: Object, callback?: (err: any, count: number) => void): Query

Parameters

  • criteria: Object
  • callback?: (err: any, count: number) => void optional

Returns

Query

public distinct(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public distinct(field: string, callback?: (err: any, res: T) => void): Query

Parameters

  • field: string
  • callback?: (err: any, res: T) => void optional

Returns

Query

public distinct(criteria: Object, field: string, callback?: (err: any, res: T) => void): Query

Parameters

  • criteria: Object
  • field: string
  • callback?: (err: any, res: T) => void optional

Returns

Query

public distinct(criteria: Query, field: string, callback?: (err: any, res: T) => void): Query

Parameters

  • criteria: Query
  • field: string
  • callback?: (err: any, res: T) => void optional

Returns

Query

public elemMatch(criteria: Object): Query

Parameters

  • criteria: Object

Returns

Query

public elemMatch(criteria: (elem: "mongoose".Query<T>) => void): Query

Parameters

  • criteria: (elem: "mongoose".Query<T>) => void

Returns

Query

public elemMatch(path: string, criteria: Object): Query

Parameters

  • path: string
  • criteria: Object

Returns

Query

public elemMatch(path: string, criteria: (elem: "mongoose".Query<T>) => void): Query

Parameters

  • path: string
  • criteria: (elem: "mongoose".Query<T>) => void

Returns

Query

public equals(val: Object): Query

Parameters

  • val: Object

Returns

Query

public exec(callback?: (err: any, res: T) => void): Promise

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Promise

public exec(operation: string, callback?: (err: any, res: T) => void): Promise

Parameters

  • operation: string
  • callback?: (err: any, res: T) => void optional

Returns

Promise

public exec(operation: Function, callback?: (err: any, res: T) => void): Promise

Parameters

  • operation: Function
  • callback?: (err: any, res: T) => void optional

Returns

Promise

public exists(val?: boolean): Query

Parameters

  • val?: boolean optional

Returns

Query

public exists(path: string, val?: boolean): Query

Parameters

  • path: string
  • val?: boolean optional

Returns

Query

public find(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public find(criteria: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • criteria: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOne(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOne(criteria: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • criteria: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndRemove(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndRemove(cond: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • cond: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndRemove(cond: Object, options: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • cond: Object
  • options: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndUpdate(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndUpdate(update: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • update: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndUpdate(cond: Object, update: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • cond: Object
  • update: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public findOneAndUpdate(cond: Object, update: Object, options: FindAndUpdateOption, callback?: (err: any, res: T) => void): Query

Parameters

  • cond: Object
  • update: Object
  • options: FindAndUpdateOption
  • callback?: (err: any, res: T) => void optional

Returns

Query

public geometry(object: Object): Query

Parameters

  • object: Object

Returns

Query

public gt(val: number): Query

Parameters

  • val: number

Returns

Query

public gt(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public gte(val: number): Query

Parameters

  • val: number

Returns

Query

public gte(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public hint(val: Object): Query

Parameters

  • val: Object

Returns

Query

public in(val: Array<any>): Query

Parameters

  • val: Array<any>

Returns

Query

public in(path: string, val: Array<any>): Query

Parameters

  • path: string
  • val: Array<any>

Returns

Query

public intersects(arg?: Object): Query

Parameters

  • arg?: Object optional

Returns

Query

public lean(bool?: boolean): Query

Parameters

  • bool?: boolean optional

Returns

Query

public limit(val: number): Query

Parameters

  • val: number

Returns

Query

public lt(val: number): Query

Parameters

  • val: number

Returns

Query

public lt(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public lte(val: number): Query

Parameters

  • val: number

Returns

Query

public lte(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public maxDistance(val: number): Query

Parameters

  • val: number

Returns

Query

public maxDistance(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public maxScan(val: number): Query

Parameters

  • val: number

Returns

Query

public merge(source: Query): Query

Parameters

Returns

Query

public merge(source: Object): Query

Parameters

  • source: Object

Returns

Query

public mod(val: Array<number>): Query

Parameters

  • val: Array<number>

Returns

Query

public mod(path: string, val: Array<number>): Query

Parameters

  • path: string
  • val: Array<number>

Returns

Query

public ne(val: any): Query

Parameters

  • val: any

Returns

Query

public ne(path: string, val: any): Query

Parameters

  • path: string
  • val: any

Returns

Query

public near(val: Object): Query

Parameters

  • val: Object

Returns

Query

public near(path: string, val: Object): Query

Parameters

  • path: string
  • val: Object

Returns

Query

public nearSphere(val: Object): Query

Parameters

  • val: Object

Returns

Query

public nearSphere(path: string, val: Object): Query

Parameters

  • path: string
  • val: Object

Returns

Query

public nin(val: Array<any>): Query

Parameters

  • val: Array<any>

Returns

Query

public nin(path: string, val: Array<any>): Query

Parameters

  • path: string
  • val: Array<any>

Returns

Query

public nor(array: Array<Object>): Query

Parameters

  • array: Array<Object>

Returns

Query

public or(array: Array<Object>): Query

Parameters

  • array: Array<Object>

Returns

Query

public polygon(coordinatePairs?: Array<number[]>): Query

Parameters

  • coordinatePairs?: Array<number[]> optional

Returns

Query

public polygon(path: string, coordinatePairs?: Array<number[]>): Query

Parameters

  • path: string
  • coordinatePairs?: Array<number[]> optional

Returns

Query

public populate(path: string, select?: string, match?: Object, options?: Object): Query

Parameters

  • path: string
  • select?: string optional
  • match?: Object optional
  • options?: Object optional

Returns

Query

public populate(path: string, select: string, model: string, match?: Object, options?: Object): Query

Parameters

  • path: string
  • select: string
  • model: string
  • match?: Object optional
  • options?: Object optional

Returns

Query

public populate(opt: PopulateOption): Query

Parameters

Returns

Query

public read(pref: string, tags?: Array<Object>): Query

Parameters

  • pref: string
  • tags?: Array<Object> optional

Returns

Query

public regex(val: RegExp): Query

Parameters

  • val: RegExp

Returns

Query

public regex(path: string, val: RegExp): Query

Parameters

  • path: string
  • val: RegExp

Returns

Query

public remove(callback?: (err: any, res: T) => void): Query

Parameters

  • callback?: (err: any, res: T) => void optional

Returns

Query

public remove(criteria: Object, callback?: (err: any, res: T) => void): Query

Parameters

  • criteria: Object
  • callback?: (err: any, res: T) => void optional

Returns

Query

public select(arg: string): Query

Parameters

  • arg: string

Returns

Query

public select(arg: Object): Query

Parameters

  • arg: Object

Returns

Query

public setOptions(options: Object): Query

Parameters

  • options: Object

Returns

Query

public size(val: number): Query

Parameters

  • val: number

Returns

Query

public size(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public skip(val: number): Query

Parameters

  • val: number

Returns

Query

public slaveOk(v?: boolean): Query

Parameters

  • v?: boolean optional

Returns

Query

public slice(val: number): Query

Parameters

  • val: number

Returns

Query

public slice(val: Array<number>): Query

Parameters

  • val: Array<number>

Returns

Query

public slice(path: string, val: number): Query

Parameters

  • path: string
  • val: number

Returns

Query

public slice(path: string, val: Array<number>): Query

Parameters

  • path: string
  • val: Array<number>

Returns

Query

public snapshot(v?: boolean): Query

Parameters

  • v?: boolean optional

Returns

Query

public sort(arg: Object): Query

Parameters

  • arg: Object

Returns

Query

public sort(arg: string): Query

Parameters

  • arg: string

Returns

Query

public stream(options?: { transform?: Function; }): QueryStream

Parameters

  • options?: { transform?: Function; } optional

Returns

QueryStream

public tailable(v?: boolean): Query

Parameters

  • v?: boolean optional

Returns

Query

public toConstructor(): Query

Returns

Query

public update(callback?: (err: any, affectedRows: number, doc: T) => void): Query

Parameters

  • callback?: (err: any, affectedRows: number, doc: T) => void optional

Returns

Query

public update(doc: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query

Parameters

  • doc: Object
  • callback?: (err: any, affectedRows: number, doc: T) => void optional

Returns

Query

public update(criteria: Object, doc: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query

Parameters

  • criteria: Object
  • doc: Object
  • callback?: (err: any, affectedRows: number, doc: T) => void optional

Returns

Query

public update(criteria: Object, doc: Object, options: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query

Parameters

  • criteria: Object
  • doc: Object
  • options: Object
  • callback?: (err: any, affectedRows: number, doc: T) => void optional

Returns

Query

public where(path?: string, val?: any): Query

Parameters

  • path?: string optional
  • val?: any optional

Returns

Query

public where(path?: Object, val?: any): Query

Parameters

  • path?: Object optional
  • val?: any optional

Returns

Query

public within(val?: Object): Query

Parameters

  • val?: Object optional

Returns

Query

public within(coordinate: Array<number>, coordinatePairs?: Array<number[]>): Query

Parameters

  • coordinate: Array<number>
  • coordinatePairs?: Array<number[]> optional

Returns

Query