Top "Mongodb-query" questions

This tag is for questions related to querying and updating MongoDB collections, either through the mongo shell or using a programming language driver.

MongoDB nested array query

I've asked this as a comment on another question, and also posted a question on mongodb-user. No responses so far, …

mongodb mongodb-query nosql
Return only matched sub-document elements within a nested array

The main collection is retailer, which contains an array for stores. Each store contains an array of offers (you can …

mongodb mongodb-query aggregation-framework
Difference between count() and find().count() in MongoDB

What is the difference between, I basically wanted to find all the documents in the mycollection. db.mycollection.count() vs …

mongodb mongodb-query
Return results mongoose in find query to a variable

I need to return the results of a query with mongoose in node.js. How do you return the value …

node.js mongodb mongoose mongodb-query
Search on multiple collections in MongoDB

I know the theory of MongoDB and the fact that is doesn't support joins, and that I should use embeded …

mongodb mongodb-query aggregation-framework
Mongoose find/update subdocument

I have the following schemas for the document Folder: var permissionSchema = new Schema({ role: { type: String }, create_folders: { type: Boolean }, …

javascript node.js mongodb mongoose mongodb-query
How to get all the values that contains part of a string using mongoose find?

I have the following problem retrieving data from MongoDB using mongoose. Here is my Schema: const BookSchema = new Schema( { _id:…

regex node.js mongodb mongodb-query aggregation-framework
How to insert an element to MongoDB internal list?

I have the following doc stored in MongoDB: { name: 'myDoc', list: [ { id:1 items:[ {id:1, name:'item1'}, {id:2, name:'item2…

mongodb mongodb-query
Multiple join conditions using the $lookup operator

Have the two following collections: // collection1: { user1: 1, user2: 2, percent: 0.56 } // collection2: { user1: 1, user2: 2, percent: 0.3 } I want to join these two collections …

mongodb join mongodb-query aggregation-framework
Include all existing fields and add new fields to document

I would like to define a $project aggregation stage where I can instruct it to add a new field and …

mongodb mongodb-query aggregation-framework