Use distinct in php MongoDB query

Use distinct in php MongoDB query

In my cars_positions database and positions collection I have this kind of data :
db.positions.find()
{ “_id” : ObjectId(“536a5cd9e9df25cd8609d286”), “car” : { “type” : “sport”, “ref” : “nameOfTheCar1” }, “position” : { “dateTime” : “2014-05-06T06:42:10”, “latitude” : “0000.1111”, “hemesphere” … Read the rest “Use distinct in php MongoDB query”

How to implement a cron job (using node-schedule) in a Node JS application

How to implement a cron job (using node-schedule) in a Node JS application

It has been a few days I have started learning Node JS.
My Node JS application has a get api which fetches the books information from the MongoDB database in json format … Read the rest “How to implement a cron job (using node-schedule) in a Node JS application”

Find count and percentage of students failed in a subject

Find count and percentage of students failed in a subject

I am new to MongoDB and learning to write mongodb queries. I need help for below problem:
Input data is a collection student having five records:
[
{
“_id”:0,
“name”:”Maxy”,
“results”:[
{
“subject”:”maths”,
“score”:1.46
},… Read the rest “Find count and percentage of students failed in a subject”

App fails to connect to MongoDB Enterprise with “Authentication failed” and Ops Manager stuck in “AdjustUsers”

App fails to connect to MongoDB Enterprise with “Authentication failed” and Ops Manager stuck in “AdjustUsers”

The credentials of a newly deployed app are rejected by MongoDB with “Authentication failed”. The MongoDB Ops Manager is stuck on “AdjustUsers” for a few hours already.

Verified by:… Read the rest “App fails to connect to MongoDB Enterprise with “Authentication failed” and Ops Manager stuck in “AdjustUsers””

Morphia aggregation stage group with object push

Morphia aggregation stage group with object push

I’m using that latest version of morphia (1.3.2) and I’m trying to replicate the following succesfull mongodb aggregation stage in Java:
{
_id: null,
pv: { $push: { t: ‘$_id’, c: ‘$c’ }}
}

example input to stage … Read the rest “Morphia aggregation stage group with object push”

how to use $lookup stage in java with spring data mongodb? [duplicate]

how to use $lookup stage in java with spring data mongodb? [duplicate]

This question already has an answer here:

lookup in mongodb aggregation

1 answer

Up to last version of spring i have seen lot of stack over flow questions which shows there is no … Read the rest “how to use $lookup stage in java with spring data mongodb? [duplicate]”

MongoDB “NumberLong/$numberLong” issue while converting back to Java Object

MongoDB “NumberLong/$numberLong” issue while converting back to Java Object

I am having a json which is somethink like {“Header” : {“name” : “TestData”, “contactNumber” : 8019071740}}
If i insert this to mongoDB it will be something like
{“_id” : ObjectId(“58b7e55097989619e4ddb0bb”),”Header” : {“name” : “TestData”,”contactNumber” : … Read the rest “MongoDB “NumberLong/$numberLong” issue while converting back to Java Object”

Why Mongoose sort is slower than native javascript sort?

Why Mongoose sort is slower than native javascript sort?

I’m using Node.js 6.10.0 and Mongoose 4.8.5. Actually I’m trying to find the nearest coordinates from a coordinate and with a certain datetime. I have billions data into my MongoDB. I want to apply a sort … Read the rest “Why Mongoose sort is slower than native javascript sort?”