Linked Questions
                        22 questions linked to/from mongodb/mongoose findMany - find all documents with IDs listed in array
                    
                
            
            
                42
            
            votes
        
        
            
                5
            
            answers
        
        
            
                67k
            
            views
        
        
            
            
            
        How do I perform an id array query in Mongoose? [duplicate]
                    Let's say I have a model called User.
I have an array with object Ids.
I want to get all User records that "intersect" with the array of Ids that I have.
User.find({ records with IDS IN [3225, ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
            
        Node.js: Mongoose filter data from array of ObjectIDs stored in collection [duplicate]
                    I am trying to search using node.js, ejs and mongoose. All the filter parameters are working perfectly but only categoryIds is not (stored as a collection of ObjectIDs in the mongodb document, ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                121
            
            views
        
        
            
            
        find elements in array available with mongodb [duplicate]
                    exp my collection users
[
    {
        _id: ObjectId('123456')
        username: 'test'
    },
    {
        _id: ObjectId('654321')
        username: 'test2'
    },
    {
        _id: ObjectId('...
                
            
       
        
            
                126
            
            votes
        
        
            
                11
            
            answers
        
        
            
                38k
            
            views
        
        
            
            
            
        Does MongoDB's $in clause guarantee order
                    When using MongoDB's $in clause, does the order of the returned documents always correspond to the order of the array argument?
                
            
       
        
            
                7
            
            votes
        
        
            
                1
            
            answer
        
        
            
                14k
            
            views
        
        
            
            
        Mongoose: Delete all referenced objects in an array when deleting referencing object
                    In my MEAN-application (Angular2) I want to delete all referenced objects when deleting the object itself. I'm using Mongoose with the remove middleware. So my question.js file looks like this:
var ...
                
            
       
        
            
                5
            
            votes
        
        
            
                2
            
            answers
        
        
            
                7k
            
            views
        
        
            
            
            
        Mongoose find with multiple values for a field
                    Select * from table_name where sport_type LIKE ('Cricket','Football');
I am trying to find the documents with sport_typeof Cricket and Football using find 
table.find({ sport_type : "Cricket" })
Can ...
                
            
       
        
            
                13
            
            votes
        
        
            
                1
            
            answer
        
        
            
                9k
            
            views
        
        
            
            
            
        Efficiently determine owner of a record in a hierarchy with MongoDB
                    I am trying to achieve the following:
  Select all the records that I own, where ownership is objects I have created OR objects a user I manage has created, where user management can be in a hierarchy ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                722
            
            views
        
        
            
            
            
        find user details from array of object ids
                    i have an array of object ids which i extracted from another instance.
these object ids represent user ids in user model. i would like to use these object ids to get the user details
How i got object ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                1k
            
            views
        
        
            
            
            
        Creating and updating documents synchronously with mongoose
                    I'm wondering what the best approach would be to realize the following situation in Node.js and mongoose:
I'm having a collection with users and a collection with groups. I want users to be able to ...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                374
            
            views
        
        
            
            
            
        Node.js: async.map getting slower
                    Hello,
I use Node.js to provide an API for storing data on a MongoDB database.
I ran multiple tests on a read method, which takes ids and returns the corresponding documents. The point is that I ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                592
            
            views
        
        
            
            
        Node.JS Mongoose findOne With for Loop
                    How can i use the for loop with findOne from mongoose in node.js, maybe have other logic that i can do the same thing?
    data = { _id: '598b4e9abe74280be0b0cb1b' }
           { _id: '...
                
            
       
        
            
                0
            
            votes
        
        
            
                0
            
            answers
        
        
            
                422
            
            views
        
        
            
            
        Q.all then not waiting for promise
                    UPDATE - Solution:
I was for looping instead should have used MongoDBs $in feature - details here
I have the following Q.all block:
Q.all([
   getFirstBlock(),
   getSecondBlock(),
])
.then(function(...
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                354
            
            views
        
        
            
            
        React/Redux/REST: sending an array
                    I'm working on a MERN project and I need your support. Which is the best way to get data with a REST call providing an array?
I have an array of ID's and would like to take data using axios and the ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                146
            
            views
        
        
            
            
        Evaluating an Array of MongoDB IDs
                    I have a search feature where filtered data is returned from my mongoDB based on a user's input for various filters. Here's an example, where records are returned that match for lastName values. This ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                129
            
            views
        
        
            
            
            
        How do I update more than one mongodb records at once? [duplicate]
                    So I am creating a basic todo app using express and mongodb at the backend, I have a task schema that looks like this :
var taskSchema = mongoose.Schema({
    task: String,
    time:Date,
    done:...