Category "mongodb"

How to reference another schema in my Mongoose schema?

I'm building a Mongoose schema for a dating app. I want each person document to contain a reference to all the events they've been to, where events is another

MongoDB Duplicate Documents even after adding unique key

I have created a collection and added a unique key like this db.user_services.createIndex({"uid":1 , "sid": 1},{unique:true,dropDups: true}) The collection

How to convert a pymongo.cursor.Cursor into a dict?

I am using pymongo to query for all items in a region (actually it is to query for all venues in a region on a map). I used db.command(SON()) before to search i

Can a subdocument be required in mongoose?

Is it possible to have nested schemas in mongoose and have a required validator on the children? Something like this: const userSchema = new mongoose.Schema({

Connect to a remote dockerized MongoDB replica set

In my remote machine, I've set up a docker container machine that I manage using docker-compose. I created 3 docker containers for each MongoDB instance I want

How would you store a number larger than the max 64 bit int in mongoDb?

The number is larger than 9223372036854775807 - too big for NumberLong, which is mongo's native 64-bit long type. What's the best way to do this/the best field

Mysql : How to run heavy analytical query at real time

I am running a crm application which uses mysql database. My application generating lots of data in mysql. Now i want to give my customer a reporting section wh

How to Convert mongodb ISODate to string in mongoDB?

I have my ISODate in mongo as ISODate and I want to just that in string format with a specific datetime format. Here is the ISODate: ISODate("2020-04-24T1

How do these database management systems practically behave during a network partition?

I am looking into deploying a database management system, replicated across regions (various data centers across a country). I am currently looking into the fol

Single instance Prisma client autocomplete not working

I have a single instance prisma but it's not auto-completing any queries. const { PrismaClient } = require("@prisma/client"); let prisma; if (process.env.NODE_E

How to search in array of array of object in mongodb

Suppose the mongodb document(table) 'users' is { "_id": "6065923bc5d509071857f6e6", "version": [ { "name": "1.1.0",

TypeError: Cannot read property '_id' of undefined when giving POST request

I have created an entire backend for creating categories for my blog application. Tech. Used: MongoDB, express-jwt, jwt Different Files are: server.js ...... /

Heroku: Cannot Get / issue for a Node project that works locally

I could really use some help on an old app I started working on a long time ago when I was first teaching myself JS. It has kind of turned into a labor of love

How to "require(module)" in mongo shell

I am writing a mongo shell script for data management. I want to write it using modular code that makes use of function libraries as modules. In some cases, m

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

My data in database: My objective is to retrieve all data of company collection (MongoDB) data from the database. The company collection holds one or many truc

"unexpected identifier error" in pagination function

although I passed the model variable in the parameters, it doesn't read them and gives a syntax error of unexpected identifier... what is the issue ....any insi

Problems with mongo csharp driver version

I use the mongo csharp driver version 1.9.1. But, I have a problem with this dll. The exception is: Could not load file or assembly 'MongoDB.Bson, Version=1.9.

mongoimport choosing field type

When importing data from file (csv in my case) mongoimport automatically choose data type for each field. Is it possible to choose data type manually for speci

Does mongo regex query have character limit, if the regex search string is more than that limit it throws error

I am seeing mongo regex query not returning result when the regex searched string is very big, instead its throwing error. I have a scenario where I append lot

Not able to create sharded collection

I have a mongodb Cluster with one config node(replication),one query node , and one shard node(with replication). I tried to create sharded collection but it is