Skip to main content

All Questions

Tagged with
-1 votes
0 answers
26 views

I want to sort my data according to nearest location

Hi i want to get data nearby location for that I am providing coordinates so its giving right data but I want all data in sorting order by coordinates like I have searched for vadodara then it should ...
sachin jogchand's user avatar
-1 votes
1 answer
19 views

I've been trying to apply unique index in combination in mongoDb databse using in my node.js backend, but unable to get away with the duplicate error

The movie is supposed to be added to the single document named as watchlist of all user, but i tried to apply unique index in combination of profile_id(user) and content_id(movie_id) so that same ...
Arish Ali's user avatar
0 votes
0 answers
21 views

Mongo DB Atlas | Aggregation not getting response

Am doing a personal project and using MongoDB Atlas for storing documents. I have the below code app.get('/admin/dashboard', (req, res) => { console.log('Received request for admin ...
Sunil's user avatar
  • 561
0 votes
0 answers
22 views

Mongodb query doesn't post or put data in deploy

I'm developing a simple forum website. It has a react frontend + node backend, with mongodb cloud as database and AWS Cognito for signup/ verification/ sign in. When a user signs up: 1. create a user ...
Leah's user avatar
  • 1
1 vote
1 answer
71 views

How to write an efficient mongo query for complex structures

I am using express/nodejs(without mongoose) and mongodb as my database. I have a collection Pages which looks something like this { _id: .. Urls: [ { IncomingUrl: "/test/test1",...
Jayendra Awasthi's user avatar
0 votes
0 answers
24 views

MongoDB, how do I speed up my geo-query for a large collection (~20M docs)?

I have a colleciton with ~20M entries. Each document being a GeoJSON object with the following format: _id: ObjectID, properties: -gml_id: String, -.... -<A few other properties that don'...
GentleCynic's user avatar
0 votes
0 answers
18 views

New user not being registered in mongodb from nodejs and express

I have developed an API using Node.js to facilitate user creation and management. Each user is granted the privilege to book visits to properties within the system. While user registration and ...
Syed Laeeq Ahmed's user avatar
0 votes
0 answers
20 views

Why my query is not executed properly in postman but when I used that query in MongoDB compass it will work fine

{members: { $in: [user] } } i am tring tring to execute this query in my project, postman show no data and in mongodb campass it is showing 1 doc and that it i want. the req.query is equal to this ...
Kashaf Dawood's user avatar
0 votes
1 answer
42 views

mongoDB how to populate sub sub document?

I have a Node.js application with a MongoDB database and using mongoose to interact with it. I have two important schemas: First is the product schema export const productSchema = new Schema({ name: ...
Daniel's user avatar
  • 95
0 votes
0 answers
46 views

Filtering MongoDB collection by date with .find() method ommits some of the records

I am trying to .filter() my MongoDB collection by date and $gte and $lte operators with the MongoDB node package. It simply doesn't work as expected and it omits some records. I have spent several ...
Primoz Rome's user avatar
  • 10.8k
0 votes
3 answers
179 views

MongoDB - $lookup not getting an appropriate result

Here I just need to look up three tables first need to get all subjects from the subject table according to classid and boardid then from the content table we need to get all topic and content details ...
Rajesh Senapati's user avatar
0 votes
1 answer
101 views

the transactions are not rolling back in mongodb

var mongo = require("mongoose") session10 = await mongo.startSession try { await session10.withTransaction(async () => { console.log("transaction ...
Xxxxx's user avatar
  • 1
1 vote
2 answers
62 views

Mongodb finding $near by data in array of objects

I'm trying to retrieve one specific object from an existing array inside the DB document, using wildcards $near and $geometry. I have a model that looks like this: const schema = new mongoose.Schema({ ...
Yegor Steshenko's user avatar
0 votes
1 answer
28 views

Optimizing MongoDB Query Get TotalRecord in Node.js

I have a MongoDB query in my Node.js application that I would like to optimize for better performance. The query looks like this: const CampaignStepHistoryList = await CampaignStepHistory.aggregate([ ...
Jayesh Rana's user avatar
1 vote
1 answer
64 views

MongoDB - findOne(query) vs countDocuments(query, {limit: 1})

I am using Node.js and its native MongoDB Driver. I am not sure which of the two methods is efficient to check if at at least one record matches my query criteria. Please note, I don't need any fields ...
SM1312's user avatar
  • 578

15 30 50 per page
1
2 3 4 5
165