Group based on a field in Mongolia

Assume I have database structure as; [ {name: "alex" , surname: "brown" , school: "washington"}, {name: "felix" , surname: "yellow" , school: "georgia"}, {name: "felix" , surname: "

MongoDB aggregates the nested network correctly

OK I am very new to Mongo, and I am already stuck. Db has the following structure (much simplified for sure): { { "_id" : ObjectId("57fdfbc12dc30a46507044ec"), "keyterms" : [ { "score" : "2", "value&q

PHP and MongoDB

I am trying to connect to MongoDB via PHP. mongod --version db version v3.2.8 Then, php -i | grep mongo /etc/php/7.0/cli/conf.d/20-mongodb.ini, mongodb mongodb support => enabled mongodb version => 1.1.8 mongodb stability => stable libmongoc vers

MongoDB aggregation / map-reduc

I'm new to MongoDB and I need to do an aggregation which seems to me quite difficult. A document looks something like this { "_id" : ObjectId("568192aef8bd6b0cd0f649c6"), "conference" : "IEEE International Conference on

Spring MVC MongoDB Index

Now my backend send to UI ObjectID as an object with timestamp, machineIdentifier, etc., but in database it stores as hex representation. Is there any way (annotation or something else) to serialize it to json as hex representation?I solved in this w

Mongo $ and selector

How does mongo $and selector work? I have trouble getting correct results back. Let's say I have a collection something like this: { "_id" : "F7mdaZC2eBQDXA5wx", "quantity" : 5 } { "_id" : "F7mdaZC2eBQDXA5wx&qu

ZF2, doctrine-mongodb and PHP7

I update a simple skeleton project ZF2 to PHP7 and I install the libraries for mongodb in php7 sudo pecl install mongodb And I add in cli the line I do a phpinfo and the extension of mongodb is 1.1.3-dev. I try to install:

ReactiveMongo fails to get down in order

Using ReactiveMongo 0.11 for Scala 2.11. I have an issue where my queries are failing to descend. The following is my Index and ReactiveMongo query: collection.indexesManager.ensure(Index(Seq("userId" -> IndexType.Ascending, "lastActivit

Mongo spring request where two fields are equal

I want to execute a query in java where path and _id are two fields of the mongo document. I want to get results list where these two fields are equal in the document. I have tried using the following query.But could not retrieve the results properly

Mongoose find all referenced documents

Does mongoose provide a way to find all referenced documents from a previous query' result? For example: Product .find(query) .exec(function(err, results) { ... Product .find({ '$or': [ // get all products where _id is in results.associatedProducts[]

The database for 'who saw this object also saw ...'

I want to create feature 'who viewed this item also viewed' like Amazon or Ebay. I'm deciding between MySql and non-relational database like MongoDB. Edit: It seems to be straightforward to implement this feature in MySql. My guess is creating 'viewe

Configuring MongoDB in Windows

I am trying to set up MongoDB on Windows, and the online docs seem far from accurate. Under "Configure a Windows Service" part, step 1 mentions to create a config file. Then it mentions to fill in the file with a line in the format logpath="

impossible to interrogate Mongodb using pymongo

i have been trying to query using .py file to mongoDB using pymongo. So the problem now is that i want the user to input the searchField personally. This is my code... from pymongo import Connection if __name__ == "__main__": con = Connection()

download the application nodejs to AWS EC2

I want to deploy my app (Nodejs + Mongodb) in EC2. After installed Nodejs and MongoDb in EC2 instances, I do not know how to upload my source code to instances and where to upload it? Thanks!When you created your instances you should have also create

MongoDB: only updates specific fields

I am trying to update a row in a (typed) MongoDB collection with the C# driver. When handling data of that particular collection of type MongoCollection<User>, I tend to avoid retrieving sensitive data from the collection (salt, password hash, etc.)

Determine the empty model variable in Django

I'm not able to determine whether a variable is empty when used in the template. I've iterated through the whole collection and in each I'm looking for a variable narrative_text. I tested the empty variable by {% ifnotequal narratives.narrative_text

Mongoose - how to set the document property as another document

I am trying to fake non-array nested documents by creating a separate model for the embedded document, validating it and if the validation is successful, setting it as the main document's property. In a POST /api/document route I am doing teh followi

Express on Node - what data store?

I'm doing my first project in node/express. I'm looking to implement a data store and noticed that express is using redis as a session store. Does this mean that express installs redis by default? The reason I ask is that I pondering whether to insta

How do I remove an embedded document from Mongoïde?

I'm having some issues deleting my document using Mongoid... The code actually does delete the gallery, but I get a browser error which looks like: Mongoid::Errors::DocumentNotFound at /admin/galleries/delete/4e897ce07df6d15a5e000001 The suspect code

MongoDB without the database?

Is it possible to use MongoDB without the database part? As really for my application what would be ideal is to just keep the database in memory, and not actually require a database server. The use case for this is to pretty much wrap a selector/quer

Mongo $ in operator performance

Is it slow / poor form to use the $in operator in MongoDB with a large array of possibilities? posts.find({ author : { $in : ['friend1','friend2','friend3'....'friend40'] } }) App Engine, for example, won't let you use more than 30 because they trans