Mongodb (mongoose) condition check is not work as I expect
I have the following BSON : [ { arr: [ { age: 24 }, { age: 55 } ] }, { arr: [ { age: 12 }, { age: 14 }, { age: 17 } ] }, { arr: […
I have the following BSON : [ { arr: [ { age: 24 }, { age: 55 } ] }, { arr: [ { age: 12 }, { age: 14 }, { age: 17 } ] }, { arr: […
I have a collection of documents where each of the documents may have an array of teamsIds like: { "id": 1, "teamsIds": ["team_a", "team_b"] } I'm trying to write an Aggregation (doing $match stage before) that will $project the documents…
I am trying to update the value of an object in a deeply nested array in mongoose, but havn't been able to come up with the correct syntax. I have tried both atomic updates and the conventional way of updating…
Here see this Collection here have a record with createdAt with 14Feb and one with 16Feb, Now querying an aggregation on the collection such as I want to add an document of 15Feb as it was missing in collection with…
I have a document like below { "name" :{ "English": "AA", "Bengali": "BB", "Gujarati": "CC", "Hindi": "DD"} } can I filter it based on the keys e.g. need to filter only on 'English' and 'Hindi' so the output should be…
I need a query to find any documents exists in users collection which has groups._id which is not present in _id of groups collection users collection - docs { "_id": ObjectId("65c35a039773c8593fc45ddb"), "email": "email", "name": "name", "groups": [ { "_id": ObjectId("65c1b7716f130b7c4190104a"),…
I am using GraphQL MongoDB Mongoose together and I have 2 collections .. users and categories like below. Category.js const mongoose = require('mongoose'); const Schema = mongoose.Schema; const categorySchema = new mongoose.Schema({ title:{ type: String, required: true }, userid: {…
i am not able to forward the response from the backend to the frontend. i already define the request to check if a user exist based on his mail and password this is how the server.js file look like const…
I am trying to benchmark MongoDB using berlinMOD data and queries. To represent a single vehicle's trip (trajectory), I'm using multiple documents (point based representation). a Sample: [{ "_id": 3, "tripid": 11, "geom_lnglat": { "type": "Point", "coordinates": [ 4.306468999999999, 50.873466799999974…
I have a nodeJS application with a mongoDB database and recently after uploading data into the images database, my api is starting to take 40+ seconds to load data. For some, even if I search through the collection with limits…