Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

SDK Database Command Index


May 20, 2021 WeChat Mini Program Development Document


Table of contents


Command

Database operator, obtained from db.command

Property

AggregateCommand aggregate

The aggregate operator

Method

Command.addToSet (value: any| Object): Command

The array updates the operator. A tomic operation. Given one or more elements, add an array unless it already exists in the array.

Command.all (values: any[]): Command

Array query operator. A query filter for array fields that requires that the array field contain all elements of a given array.

Command.and (expressions: any[]): Command

A query operator that represents the relationship between logical "and" and that multiple query filters need to be met at the same time

Command.bit (object: Object): Command

Update the operator. Bit operations are performed on the field, and and/or/xor operations can be performed.

Command.elemMatch (condition: Object| Command): Command

A query filter for array fields that requires the array to contain at least one element that meets all the criteria given by elemMatch

Command.eq (value: any): Command

A query filter that means that a field is equal to a value. The eq instruction accepts a literal amount, which can be number, boolean, string, object, array, Date.

Command.exists (value: boolean): Command

Determine if the field exists

Command.expr (aggregateExpression: Expression): Command

Query the operator, used to use the polymeric expression in the query statement, the method receives a parameter, the parameter must be a polymeric expression

Command.geoIntersects (options: Object): Command

Find a record of a given geographic graphic intersection

Command.geoNear (options: Object): Command

Find the field value in the nearby record from the near future.

Command.geoWithin (options: Object): Command

Find the records in the specified area, no sorting.The specified area must be a polygon or a multipolygon.

Command.gt (value: any): Command

Query the screening operator, indicating that it is more than the specified value.It can be passed to the Date object for a date comparison.

Command.gte (value: any): Command

Query the screening operator, indicating that it is greater than or equal to the specified value.It can be passed to the Date object for a date comparison.

Command.in (value: any[]): Command

The query filter operator indicates that the required value is in a given array.

Command.inc (value: number): Command

Update the operator, atomic operation, used to indicate that the field is from

Command.lt (value: any): Command

Query the screening operator, indicating that it takes less than the specified value.It can be passed to the Date object for a date comparison.

Command.lte (value: any): Command

Query filter operator, which means that the specified value needs to be less than or equal to. Date objects can be passed in for date comparison.

Command.max (value: any): Command

Update the operator, given a value that is only updated if the value is greater than the current value of the field.

Command.min (value: any): Command

Update the operator, given a value that is only updated if it is less than the current value of the field.

Command.mod (divisor: number, remainder: number): Command

The query filter operator, given the divisor and the remainder, requires the field to be divided when the value % divisor is the remainder.

Command.mul (value: number): Command

Update the operator, the atomic action, to indicate that the field is multiplied by a value

Command.neq (value: any): Command

A query filter that means that a field is not equal to a value. The eq instruction accepts a literal amount, which can be number, boolean, string, object, array, Date.

Command.nin (value: any[]): Command

The query filter operator, which means that the required value is not in a given array.

Command.nor (expressions: any[]): Command

A query operator that represents a relationship with a logical "no" that does not meet all the specified criteria. If there are no fields in the record, the criteria are met by default.

Command.not (command: Command): Command

A query operator that represents a logical "non" relationship that does not meet the specified criteria.

Command.or (expressions: any[]): Command

A query operator that represents a logical "or" relationship that requires multiple query filters to be met at the same time. Or instructions can be used in two ways, between "or" for field values and for cross-field "or" operations.

Command.pop (): Command

The array updates the operator to remove the tail element of the array from a field with an array value

Command.pull (value: any): Command

The array updates the operator. Given a value or a query condition, all elements in the array that match a given value or query condition are removed.

Command.pullAll (value: any): Command

The array updates the operator. G iven a value or a query condition, remove all elements in the array that match the given value. The difference with pull is that only constant values can be specified and arrays are passed in.

Command.push (values: Object): Command

The array updates the operator. F or a field with an array of values, add one or more values to the array. Or if the field was originally empty, the field is created and an array is set as an incoming value.

Command.remove (): Command

Update the operator to indicate the deletion of a field.

Command.rename (value: string): Command

Update the operator and rename the field. I f you need to rename nested deep fields, you need to use point path notation. Fields for objects nested in arrays cannot be renamed.

Command.set (value: any): Command

Update the operator to set the field equal to the specified value.

Command.shift (): Command

The array updates the operator to remove the array header element from a field with an array value.

Command.size (value: string): Command

Update the operator, the query filter for array fields, to require the array length to be a given value

Command.unshift (values: any[]): Command

The array updates the operator to add one or more values to the head of the array for a field with an array value. Or if the field was originally empty, the field is created and an array is set as an incoming value.