Class

io.scalajs.npm.mongoose

Aggregate

Related Doc: package mongoose

Permalink

class Aggregate[T] extends Object with QueryExecutable[T]

Mongoose Aggregate

Annotations
@RawJSType() @native() @JSImport( "mongoose" , "Aggregate" )
See also

http://mongoosejs.com/docs/api.html#aggregate_Aggregate

Linear Supertypes
QueryExecutable[T], Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Aggregate
  2. QueryExecutable
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Aggregate(ops: Any)

    Permalink

    Aggregate constructor used for building aggregation pipelines.

    Aggregate constructor used for building aggregation pipelines.

    ops

    aggregation operator(s) or operator array

    returns

    a new Aggregate instance

    Examples:
    1. new Aggregate([{ $project: { a: 1, b: 1 } }, { $skip: 5 }]);

    2. ,
    3. new Aggregate({ $project: { a: 1, b: 1 } }, { $skip: 5 });

    4. ,
    5. new Aggregate({ $project: { a: 1, b: 1 } });

    6. ,
    7. new Aggregate();

  2. new Aggregate()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addCursorFlag(flag: String, value: Boolean): Aggregate.this.type

    Permalink

    Adds a cursor flag

    Adds a cursor flag

    flag

    the flag

    value

    the value

  5. def allowDiskUse(value: Boolean, tags: Any): Aggregate.this.type

    Permalink

    Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0)

    Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0)

    value

    Should tell server it can use hard drive to store data during aggregation.

    tags

    optional tags for this query

  6. def append(ops: Any): Aggregate.this.type

    Permalink

    Appends new operators to this aggregate pipeline

    Appends new operators to this aggregate pipeline

    ops

    the operator(s) to append

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collation(collation: RawOptions, value: Boolean): Aggregate.this.type

    Permalink

    Adds a collation

    Adds a collation

    collation

    the collation options

    value

    the boolean indicator

  10. def cursor(options: RawOptions): AggregateCursor[T]

    Permalink

    Sets the cursor option option for the aggregation query (ignored for < 2.6.0).

    Sets the cursor option option for the aggregation query (ignored for < 2.6.0). Note the different syntax below: .exec() returns a cursor object, and no callback is necessary.

    options

    the set the cursor batch size

    Example:
    1. var cursor = Model.aggregate(..).cursor({ batchSize: 1000 }).exec();
        cursor.each(function(error, doc) {
        // use doc
      });
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def exec(callback: Function2[MongooseError, T, Any]): Unit

    Permalink
    Definition Classes
    QueryExecutable
  14. def exec(): Promise[T]

    Permalink
    Definition Classes
    QueryExecutable
  15. def explain(callback: Function2[MongooseError, T, Any] = js.native): Promise[T]

    Permalink

    Execute the aggregation with explain

    Execute the aggregation with explain

    callback

    the callback

    returns

    a promise of the results

  16. def facet(facet: RawOptions): Aggregate.this.type

    Permalink

    Combines multiple aggregation pipelines.

    Combines multiple aggregation pipelines.

    facet

    the options

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def graphLookup(options: RawOptions): Aggregate.this.type

    Permalink

    Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection.

    Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. Note that graphLookup can only consume at most 100MB of memory, and does not allow disk use even if { allowDiskUse: true } is specified.

    options

    to $graphLookup as described in the above link

  20. def group(arg: Any): Aggregate.this.type

    Permalink

    Appends a new custom $group operator to this aggregate pipeline.

    Appends a new custom $group operator to this aggregate pipeline.

    arg

    the $group operator contents

  21. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  25. def limit(num: Int): Aggregate.this.type

    Permalink

    Appends a new $limit operator to this aggregate pipeline.

    Appends a new $limit operator to this aggregate pipeline.

    num

    the maximum number of records to pass to the next stage

  26. def lookup(options: RawOptions): Aggregate.this.type

    Permalink

    Appends new custom $lookup operator(s) to this aggregate pipeline.

    Appends new custom $lookup operator(s) to this aggregate pipeline.

    options

    to $lookup as described in the above link

  27. def match(arg: Any): Aggregate.this.type

    Permalink

    Appends a new custom $match operator to this aggregate pipeline.

    Appends a new custom $match operator to this aggregate pipeline.

    arg

    the $match operator contents

  28. def model[A](model: MongooseModel[A]): Aggregate.this.type

    Permalink

    Binds this aggregate to a model.

    Binds this aggregate to a model.

    model

    the model to which the aggregate is to be bound

    returns

    the Aggregate

  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. def near(parameters: RawOptions): Aggregate.this.type

    Permalink

    Appends a new $geoNear operator to this aggregate pipeline.

    Appends a new $geoNear operator to this aggregate pipeline. NOTE: MUST be used as the first operator in the pipeline.

    parameters

    the given parameters

  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. def project(arg: |[String, Any]): Aggregate.this.type

    Permalink

    Appends a new $project operator to this aggregate pipeline.

    Appends a new $project operator to this aggregate pipeline.

    arg

    the field specification

    returns

    the Aggregate

  34. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  35. def read(pref: String, tags: Any = js.native): Aggregate.this.type

    Permalink

    Sets the readPreference option for the aggregation query.

    Sets the readPreference option for the aggregation query.

    pref

    one of the listed preference options or their aliases

    tags

    optional tags for this query

    returns

    the Aggregate

  36. def sample(size: Int): Aggregate.this.type

    Permalink

    Appepnds new custom $sample operator(s) to this aggregate pipeline.

    Appepnds new custom $sample operator(s) to this aggregate pipeline.

    size

    the number of random documents to pick

    returns

    the Aggregate

  37. def skip(num: Int): Aggregate.this.type

    Permalink

    Appends a new $skip operator to this aggregate pipeline.

    Appends a new $skip operator to this aggregate pipeline.

    num

    the number of records to skip before next stage

    returns

    the Aggregate

  38. def sort(arg: |[String, Any]): Aggregate.this.type

    Permalink

    Appends a new $sort operator to this aggregate pipeline.

    Appends a new $sort operator to this aggregate pipeline.

    arg

    the sorting arguments

    returns

    the Aggregate

    Examples:
    1. aggregate.sort('field -test');

    2. ,
    3. aggregate.sort({ field: 'asc', test: -1 });

  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def then(resolve: Function = js.native, reject: Function = js.native): Promise[T]

    Permalink

    Provides promise for aggregate.

    Provides promise for aggregate.

    resolve

    the success callback

    reject

    the error callback

    returns

    a promise

    Example:
    1. Model.aggregate(..).then(successCallback, errorCallback);

  41. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. def unwind(fields: String): Aggregate.this.type

    Permalink

    Appends new custom $unwind operator(s) to this aggregate pipeline.

    Appends new custom $unwind operator(s) to this aggregate pipeline.

    Note that the $unwind operator requires the path name to start with '$'. Mongoose will prepend '$' if the specified field doesn't start '$'.

    fields

    the field(s) to unwind

    returns

    the Aggregate

  44. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from QueryExecutable[T]

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped