Category "mongodb"

MongoDB query inside an array

I want to use this mongoDB collection: [ { "_id": { "$oid": "627c4eb87e7c2b8ba510ac4c" }, "Contact": [ { "name": "ABC",

Trying to find "magic combinations" in MongoDB

I have two MongoDB collections in a database named "records". Here's a sample document from the first collection: course_completions { "_id" : NumberInt(1

Delete object from inner schema in mongoose?

How do I delete object from inner schema in mongoose? I try to delete comments from the Holiday Schema, this is the holiday schema: const holidaySchema = new mo

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]

I have the following setup in Visual Studio Code for nodejs project: Model: genre.js const Joi = require('joi'); const mongoose = require('mongoose'); const

.mongo' is not recognized as an internal or external command, operable program or batch file

I have installed mongo db. Then when i tried to execute .mongo or mongo in command prompt. It's showing this error: .mongo' is not recognized as an internal

Failed to introspect annotated methods on class org.springframework.data.mongodb.core.SimpleMongoDbFactory

I was getting error: Failed to introspect annotated methods on class org.springframework.data.mongodb.core.SimpleMongoDbFactory. Here is the full stacktrace: 0

Increment value in update query mongoDB

I am trying to add two values in a mongoose function. This the function im using: Equipa.findOne({ '_id': req.params.equipaID }, function (error, equipa) {

Find documents in mongoDB collection by coordinates via haversine formula

I have this structure in my collection { "categorie" : "Introduction", "quart" : "jour", "pdq" : 23, "x" : 302375.197993, "y" : 5046522.116

Can Mongo Bulk Operations like insertMany Partially Fail?

After scouring the documentation and posts online, there is one thing I have never been clear about with Mongo. When you are attempting to write documents in bu

MongoDb Java- deeper polymorph tree

I have the following polymorphic structure for objects I want to store in MongoDb: InventoryItem (abstract) / \

lookup on all documents inside an array - MongoDB aggregation

I need to execute a lookup stage on all documents inside an array. The collection: { { "name": "test", "age": 2, "replies": [ {

node.js moongose find populate cant access to array

I have this in my backend: ad = await Ad.find({'company': companyId}).populate('creator'); And when i console.log(ad) i get this: [ { connections: [],

how is possible create database inside existing cluster with Mongo atlas api endpoint?

how is possible create database inside existing cluster with Mongo atlas api? I'm trying to use POST /groups/{GROUP-ID}/databaseUsers but didn't work. https://w

using fiware orion with azure cosmos db mongo api

We are currently using fiware Orion with Mongo DB on a docker container in a Kubernetes cluster and everything works fine, however as soon as I am trying to use

Laravel mongodb where array field contains value

I use mongodb and mysql together with Laravel. Fields table in mysql database can have more options in mysql database. fields table in mysql: id, name options

MongoDB Docker URI does not have hostname, domain name and tld

I am trying to connect to my local MongoDB Database that is on docker with nodejs. My component are: .env file MONGODB_USERNAME = 'accountUser' MONGODB_PASSWORD

Geospatial 2dsphere index not creating in MongoDB Atlas and manually

I am trying to create a 2sphere index in my mongodb collection. The index needs to be on location field which is at GeoJSON format: location: { coordinat

Nested objects in response not logging to console

My server gets a response from another server with a document from a mongodb database with a body similar to { messageDetails: { body: "hello" }

How to use $arrayElemAt with MongoDb

I have the following pipeline, which I want to use it in Golang and convert it to bson.M. One way is using bson.UnmarshalExtJSON but I want to know what is exac

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

I'm using symfony 3.4 with DoctrineMongoDBBundle and LexikJWTAuthenticationBundle . I'm trying to create a user login which return JWT token. If i specify the u