Skip to content

Tag Archives: Mongoose

Mongoose is an Object Data Modeling (ODM) library for MongoDB. It defines a strongly-typed-schema, with default values and schema validations which are later mapped to… Read More
The $lookup operator is an aggregation operator or an aggregation stage, which is used to join a document from one collection to a document of… Read More
In MongoDB, Population is the process of replacing the specified path in the document of one collection with the actual document from the other collection.… Read More
In Mongoose, the virtual is the property that is not stored in the database, they only exist logically, and you cannot query directly on the… Read More
Mongoose is an Object Data Modeling (ODM) library for MongoDB. It defines a strongly-typed-schema, with default values and schema validations which are later mapped to… Read More
Virtuals are document properties that do not persist or get stored in the MongoDB database, they only exist logically and are not written to the… Read More
Mocha: Mocha is a testing framework that is used to perform tests within our application.It makes sure everything works correctly. ‘Mocha in Node.js’ means using… Read More
The Query.prototype.circle() function is used to specify a $center or $centerSphere condition. It specifies a circle for a $geoWithin query.Syntax:   Query.prototype.circle() Parameters: This function has… Read More
The Query.prototype.Symbol.asyncIterator() function is used to return an asyncIterator for use with for/await/of loops. And it works for find() queries. User does not need to… Read More
The Query.prototype.geometry() function is used to specify a $geometry condition. The geometry can be provided in an array which is passed as parameter.  Syntax:   Query.prototype.geometry()… Read More
The Query.prototype.$where() specifies a JavaScript function or expression to pass to MongoDB’s query system. Using this, where the condition can be customized according to the… Read More
The Query.prototype.explain() function is used to set the explain option thereby making this query return detailed execution stats instead of the actual query result. Syntax:… Read More
The Query.prototype.limit() function is used to specify the maximum number of documents the query will return. It accepts a number type parameter. Syntax:  Query.prototype.limit() Parameters:… Read More
The Query.prototype.exec() function is used to execute the query. It can handle promises and executes the query easily. The callback can be passed as an… Read More
The Query.prototype.error() function is used to sets/gets the error flag on this query. If this flag is undefined or not null then the exec() promise… Read More