Category "mongodb"

How do I use Spring Mongo to group two fields and get a array of one fields based on the other?

Let me give a example here: Two entries in the collection Author: { "name" : "Joe" "Book" : "A" }, { "name" : "Joe" "Book" : "B" } Now, if I use the aggrega

mongodb how to get the correct uri

I've inherited node.js, mongodb system. The original dev used a mlab db on his own account, I was asked to copy to a different db. When I tried to create a ml

String field value length in mongoDB

The data type of the field is String. I would like to fetch the data where character length of field name is greater than 40. I tried these queries but returni

Readiness probe failes because mongosh --eval freezes

I installed the latest bitnami/mongodb chart for a standalone architecture. The Readiness and Liveness-probes are failing because the statement mongosh --eval "

spring mongodb - How to provide match condition to check for empty array using spring data mongodb api?

how to perform below operation (it is the actual mongo query) using MatchOperation in Spring data mongodb ? $match: { "docs": { $ne: [] } } here docs is an a

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