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.

Querying internal array size in MongoDB

Consider a MongoDB document in users collection: { username : 'Alex', tags: ['C#', 'Java', 'C++'] } Is there any way, to …

mongodb mongodb-query nosql
Loop through all Mongo collections and execute query

First of, I'm quite new to mongodb. Here's my question I've not been able to find a solution to. Let's …

javascript mongodb mongodb-query mongo-shell
group in mongo excluding null values

I have mongo query which does the group operation on the documents. I have almost got the expected results except …

mongodb mongodb-query aggregation-framework mongodb-aggregation
Searching by ObjectId on Mongo Compass

How does one use Mongo Compass and search by ObjectID? I've been searching for the documentation for this but haven't …

mongodb mongodb-query mongodb-compass
Mongodb Join on _id field from String to ObjectId

I have two collections User { "_id" : ObjectId("584aac38686860d502929b8b"), "name" : "John" } Role { "_id" : ObjectId("584aaca6686860d502929b8d"), "…

mongodb join mongodb-query aggregation-framework lookup
Return actual type of a field in MongoDB

In MongoDB, using $type, it is possible to filter a search based on if the field matches a BSON data …

mongodb mongodb-query aggregation-framework
Difference between Find and FindAsync

I am writing a very, very simple query which just gets a document from a collection according to its unique …

c# mongodb mongodb-query mongodb-csharp-2.0
Updating a Nested Array with MongoDB

I am trying to update a value in the nested array but can't get it to work. My object is …

javascript node.js mongodb mongoose mongodb-query
MongoDB Regex Search on Integer Value

I want to regex search an integer value in MongoDB. Is this possible? I'm building a CRUD type interface that …

regex mongodb mongodb-query aggregation-framework
Mongoose sort the aggregated result

I'm having a lot of difficulty in solving this mongodb (mongoose) problem. There is this schema 'Recommend' (username, roomId, ll …

node.js mongodb mongoose mongodb-query aggregation-framework