mongodb

Does MongoDB work on iOS?

The title pretty much says it all: Has MongoDB ever been compiled to work on iOS devices? I know the terms of the App Store do not allow an application to launch a subprocess, so the DBDirectClient class would have to be used to access the data files in-process. Any thoughts? ...

MongoDB and Java Objects

Hi, I have the following MongoDB object stored in my Mongo database: array ( '_id' => new MongoId("4cc183de48aa4c7708000000"), 'vehicleMake' => 'Volkswagen', 'vehicleModel' => 'Carrier', 'vehicleNumPassengers' => '7', 'vehicleReg' => '07-D-748393', 'coords' => array ( 0 => array ( 'lat' => '53.2594946', ...

How to connect Mongodb from Excel

I want to connect to a mongodb database using excel macros, does anybody knows how to acomplish this task? ...

too much data duplication in mongodb?

so i'm new to this whole NOSQL stuff and have recently been intrigued with mongoDB. i'm creating a new website from scratch and decided to go with MONGODB/NORM (for C#) as my only database. i've been reading up a lot about how to properly design your document model database and i think for the most part i have my design worked out pret...

MongoDB as a cache for frequent joins and queries from MySQL

Im thinking about doing the following and need suggestions if it makes sense to approach it this way. Basically since I am able to do queries in MongoDB and MongoDb is wicked fast at these since the hotspots of the data are cached in memory. I was thinking of storing data I would normally do a join from in mysql in mongoDB. While I am us...

Mongo: Would you store username or reference to username inside second collection?

Let's take a simple example, a blog post. I would store comments to a particular post within the same document. messages = { '_id' : ObjectId("4cc179886c0d49bf9424fc74"), 'title' : 'Hello world', 'comments' : [ { 'user_id' : ObjectId("4cc179886c0d49bf9424fc74"), 'comment' : 'hello...

How udate the _id of one MongoDB Document ?

I want update an _id MongoDB of one document. I know it's not a really good pratice. But with some technical reason, I need update it. But If I try to update it I have : > db.clients.update({'_id':ObjectId("4cc45467c55f4d2d2a000002")}, {'$set':{'_id':ObjectId("4c8a331bda76c559ef000004")}}); Mod on _id not allowed And the update is not...

Embedding message replies inside message parent with mongodb using mongoid

I think it's a best practice to embed replies to a specific message inside that message and I'm trying to implement it using mongoid. here is what I have class Message include Mongoid::Document include Mongoid::Timestamps include Mongoid::Paranoia field :subject field :body field :sender_deleted, :type => Boolean, :defaul...

Queries from Java in MongoDB shell syntax

Is it possible to use the Java MongoDB driver to run queries in the same syntax as MongoDB shell from Java code? Something like, for example, DBCursor cursor = mongo.runQuery("db.things.find();"); ...

How can I query mongodb using mongoid/rails without timing out?

I have a rake task that processes a set of records and saves it in another collection: batch = [] Record.where(:type => 'a').each do |r| batch << make_score(r) if batch.size %100 == 0 Score.collection.insert(batch) batch = [] end end I'm processing about 100K records at a time. Unfortunately at 20 minutes, ...

Query embedded object with AND in mongodb

Let's say there is: {username : "tom1", address : { type : 0, year : 2001 }} {username : "tom2", address : { type : 1, year : 2011 }} {username : "tom3", address : { type : 0, year : 2031 }} {username : "tom4", address : { type : 1, year : 2002 }} I'm using Java Driver, how can I query: users who's address.type = 1 AND address.year > ...

MongoDB mongorestore and existing collection with records

I need to import (restore) a collection generated with mongodump into an existing database and I'd like the records to be merged into the existing collection. Does mongorestore merge the records in the same collection or it will drop the existing collection before restoring the records? ...

Strategies for keeping Map Reduce results around for subsequent queries

I'm using Map Reduce with MongoDB. Simplified scenario: There are users, items and things. Items include any number of things. Each user can rate things. Map reduce is used to calculate the aggregate rating for each user on each item. It's a complex formula using the ratings for each thing in the item and the time of day - it's not ...

Get MongoDB Databases in a Javascript Array?

I know that in the MongoDB terminal, I can run "show dbs" to see the available databases. I want to get them programmatically so that I can iterate over them and delete some based upon a regular expression. I have tried db.runCommand("show dbs") but that doesn't work. Thanks in advance. ...

MongoDB, Complex Queries, and Performance

Back-Story On a current project, I am using MySQL and SQLite in combination with each other. I'm currently giving each user their own SQLite database to get around my provider's 1GB MySQL DB limit. It's worked out alright and the performance is good, but I know for a fact that continual maintenance of these flat-file databases will be a...

MongoDB: C# or JavaScript?

Hi! I am not deep in working with MongoDB. But i want to use it with C# driver. I guess that not all features can be available in this driver (Am i right?). Or for example, it easy to find some code written on javascript and, so, it seems easy to use it without mapping/finding appropriate methods in C# driver. I know that MongoDB is wri...

mongo: error while loading shared libraries

I get this error when I try to run mongo, in ubuntu. mongo: error while loading shared libraries: libboost_thread-gcc42-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory I upgraded to Karmic yesterday. I have installed mongodb-stable from the repo mentioned here. I tried to apt-get libboost, but there is n...

Django and MongoDB Engine - Problem with object IDs!

Hi folks, I'm using Django 1.3beta and django-mongodb-engine for database backend. Problem is when I save an object with a pk set I get this error: /usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.pyc in get_prep_lookup(self, lookup_type, value) 290 return value 291 elif lookup_type i...

Twitter-like app using MongoDB

I'm making an app that uses the classic "follow" mechanism (the one used by Twitter and a lot of other apps around the web). I'm using MongoDB. My system has a difference, though: an user can follow groups of users. That means that if you follow a group, you'll automatically follow all the users who are members of that group. Of course ...

MongoDB's GridFS, Rails 3, X-Sendfile, and ACL's, HOW-TO ?

I have a Rails 3 project that does file upload/download, with access rights (User has many Files, and can only read/write his own files). If I store my files on classic filesystem, I can check the access to the file in my rails app and then use X-Sendfile header to redirect to the file, if user has access. In this way, a user can neve...