Questions for mongodb


Create controller tests for Mongoid embedded models

I'm working on a Rails 3 app that allows users to follow movies by adding them to their queue, so that they're notified when the movies are premiering.

Odd behavior with mongodb find

In my DB when I execute db.markers.find() I have this result:

How to model many-to-many relationships in MongoDB (for a MySQL user)

I come from a MySQL background and am trying to wrap my head around MongoDB. In particular, I'm struggling to conceptualize how I should model n:n relationships the "Mongo way."

MongoDB arrays vs objects

Lets say I want to maintain a list of items per user (in MongoDB with Mongoose ODM in Node.js environment) and later query to see if an item is owned by a user. For example, I want to store all of...

Defining a different primary key in Mongomapper

I am defining a primary key in MongoMapper.

MongoDB-upsert: fire and forget

I know that MongoDB uses async writes by default when inserting/updating/deleting documents. My question is if these updates are still performed in order.

MongoDB limit storage size?

What is MongoDB's storage size limit on 64bit platforms? Can MongoDB store 500-900 Gb of data within one instance (node)? What was the largest amount of data you've stored in MongoDB, and what was ...

Union two mongo results

I have a situation where I need to return a single collection of objects from mongo, but need to use two queries to get the results. The order of these results is important because they are paginat...

Any easy way to tell if mongodb indexes are still being used or not?

As code for my project is evolving, new indexes are being put in place and I am sure some old ones are no longer necessary. However before I just drop them to see if anything slows down or not, I'd

Bundle don't works with mongo_ext

I have a problem with a very simple Gemfile:

mongodb - insert but limit the total records?

A while back when I was researching MongoDB I came across an article where they explained how to be able to insert records but only keep 10 (for example), so once it hit 10 records then it would de...

Map Reduce with mongo on nested document

I have the following document structure:

Why updating DateTime in MongoDB getting wrong value?

I have one model with DateUpdated DateTime property.

How can I loop through docs to send a lot of mongojs data to a jade template?

So, I'm using mongojs. To get values into a rendered view, it was my understanding that one had to do something like this:

How to Post data with express?

I have a pretty good understanding of how to use the app.get function, but I'm having trouble with the

MongoDB: Function Not Defined During Mapreduce

I am running mapreduce on a collection with 1.15M documents. In the case of duplicates, when I return a result, I want to prefer some documents values over others (i.e. a field value in one documen...

using key as value in Mongoengine

I use mongoengine for mongodb in django.

MongoDB: remove unique constraint

I'm trying the "Develop a RESTful API Using Node.js With Express and Mongoose" example and I ran into a problem with the MongoDB Schema:

mongo db indexes on embedded documents

I have a domain object model as below...

MongoDB queries and results parsing

My database is structured as follows:

MongoDB: Function to Consolidate Arrays

I have a large dataset with documents that sometimes cross-reference each other, sometimes do not. Before I can mapreduce based on those cross references, I have to set the array of cross-reference...

Ruby on Rails and MongoDB

I have a new Ruby on Rails installation where I can see the default start-page.

Mixing Linux and Windows MongoDB replica set and is equal hardware important for sharding

My first question is really simple, I just want to know if I can mix Linux and Windows mongodb servers in my sharding/replica cluster, ofc with same version like 2.2?

Is it a good practice to build a collection cache?

I'm experiencing with MongoDB with Node.js using the plugin node-mongodb-native. A problem I'm experiencing is the amount of nested callbacks. I'm trying to simplify a few things by lessening the c...

Test existence of argument in mongo script

I'm trying to pass a param into a mongodb script by doing the following:

Java code for getting data from SQL server to MongoDB

I have been struggling with my Mongo-SQL code for a while and still need your help :)

How to properly load-balance with Node.js / Mongoose / MongoDB + ConnectSet?

I'm using Node.js+Express+Mongoose to connect to my MongoDB replica set (3x instances).

Shutting Down Sharded MongoDB Cluster Cleanly

I currently have a mongoDB setup with a mongos server, a config server, and 2 shards of 3 mongod (master-slave) servers each. I would like to ensure that when I shut them down they are shut down cl...

How do I get the last item in a MongoDB collection?

I'm using MongoDB for sometime to perform all sort of fast inserts or having as a log, but I'm having some trouble to get a really simple query

Modify the order in which properties are displayed in MongoDB

I am using PyMongo to insert data (title, description, phone_number ...) into MongoDB. However, when I use mongo client to view the data, it displays the properties in a strange order. Specifically,

What is the JavaScript engine that runs mongoDB shell?

Is it V8? Can't seem to find this information.

Installing mongodb in mac

I am trying to install mongodb on my system and following these steps( in doing so. I have installed Homebrew and MacPorts and have

Get the updated document in MongoDB

I need to get the _id (the Mongo ObjectID) of updated document. For this I want to get the updated document. How can I get it?

Using Mongoose and MongoDB, can I combine a document update using req.body and an increment using $inc?

I want to update a document using the inbound form fields from req.body without having to break them apart and build out a $set. I have this working just fine. Now I want to add an increment to a f...

Mongo shell execute query from file and show result

How to execute external file using mongo shell and see the result in console?

How to keep 32 bit mongodb memory usage down on changing dataset

I'm using MongoDB on a 32 bit production system, which sucks but it's out of my control right now. The challenge is to keep the memory usage under ~2.5GB since going over this will cause 32 bit sys...

What Exactly Gets Stored in MongoDB Logs?

So what gets stored in MongoDB logs? I checked out MongoDB documentation and wasn't able to find anything concrete on the subject, so I figured I would ask here.

MongoDB database design with embedded documents

I have a few thousand strings (items) that I would like to translate. I have structured my MongoDB as follows:

Does mongoose's “distinct” function support regex in a query?

I have the following bit of js in a node/mongoose project. I'm working on an autocomplete form. It works just fine with a regular "find", but I want to do a "distinct" find instead.

fairly simple time based queue in MongoDB

I am trying to implement a fairly simple queue using MongoDB. I have a collection which a number of dumb workers needs to process. Each worker should search the collection for unprocessed work and ...

Using MongoExport, how do I control the output of Date fields?

I am trying to format some data from Mongo into a CSV. One of the fields is stored as an ISODate, so when querying Mongo, comes out like this:

how to return a value for a function in coffee-script

I used coffee-script to write node.js, it works fine, what i want to know is how to return a value for a function in coffee-script, here is my code

MongoDB $where optional field

I'm creating a MongoDB query returning the users whose birthday is today, so I created this JS function in the $where statement:

Persisting and retrieving a Map of Maps with Morphia and Mongodb

I would like to be able to persist and retrieve, amongst other things, a map of maps in a MongoDB collection. I am using Java to access the MongoDB via Morphia.

What is the basic architecture of a node.js + mongodb app?

I've been looking for ages with no luck. I found some modules on GitHub but unfortunately, were outdated. Does anyone know any CRUD module or tutorial for node.js 0.6.x + mongodb?

use the database id as the restful service id expose a threat?

I have a restful service for the documents, where the documents are stored in mongodb, the restful api for the document is /document/:id, initially the :id in the api is using the mongodb 's object...

MongoDB query database for time

Is there a way to query mongodb in such a way that I can retrieve the time?

Is it MongoDB suitable for authentication and sensitive oprations?

I want to create a web based chat system with authentication.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.