mongodb

Passing a dictionary to a view Asp.net MVC

I'm pulling data from MongoDB in C# Asp.net MVC2. Here is the code I'm using in the controller. var mongo = new Mongo(); mongo.Connect(); var db = mongo.GetDatabase("DDL"); var Provinces = db.GetCollection("Provinces"); var documents = Provinces.FindAll().Documents; ViewData["Document"] = documents; return View(); Now I'm unsure ho...

Do any visual tools exist for MongoDB (for Windows)?

I'm currently using MongoDB in a reporting system and have to delete a whole bunch of test documents. While I don't have too much trouble using the JSON-based command-line tools, it gets extremely tedious to have to keep searching for documents, copy-and-pasting OIDs, etc., especially from a command prompt window (ever tried to "mark" t...

Mongoid - getting all attributes including embedded documents

Is there an easy way to get all attributes of a Mongoid document, including those of embedded documents? For example, if I have the following documents: class Person include Mongoid::Document embeds_many :phone_numbers field :name end class PhoneNumner include Mongoid::Document embedded_in :person, :inverse_of => :phone_numb...

Create rails locale yaml file automatically ?

hi is it possible to create / update a locale language yaml file from with a rails application ? If so is would it be automatically pulled into the load path somehow as i dont want to have to restart to pull in the new changes ? Is this possble and if so how ?? or is there a better way ? I am using mongodb as a db. thanks rick ...

Mongodb , rails modify non-array - debug kind_of? Array >> true

I've been trying to add to an array (or what ruby is saying is an array), but keep getting an error from mongo which says Cannot apply $addToSet modifier to non-array when I try to run User.collection.update({'id'=> current.id},{'$addToSet'=>{ 'following' => current.id}}) User.collection.update({'id'=> user.id},{'$addToSet'=...

Creating indexes - MongoDB

Hi folks, my "table" look like this: {'name':'Rupert', 'type':'Unicorn', 'actions':[ {'time':0, 'position':[0,0], 'action':'run'}, {'time':50, 'position':[50,0], 'action':'stoprun'}, {'time':50, 'position':[50,0], 'action':'jump'}, {'time':55, 'position':[50,0], 'action':'laugh'}, ... ]} any way I can index the it...

Various queries - MongoDB

Hi folks, This is my table: unicorns = {'name':'George', 'actions':[{'action':'jump', 'time':123123}, {'action':'run', 'time':345345}, ...]} How can I perform the following queries? Grab the time of all actions of all unicorns where action=='jump' ? Grab all actions of...

Get ID of last inserted document in a mongoDB w/ Java driver

Is there an easy way to get the ID (ObjectID) of the last inserted document of a mongoDB instance using the Java driver? ...

MongoDB NoRM: query nested objects using Expando

I saw this Q&A http://stackoverflow.com/questions/2900763/mongodb-norm-query-nested-objects, but it seems to apply to strongly-typed objects only. Is there a way to do a find or update a nested field on an Expando object (http://wiki.github.com/atheken/NoRM/expando)? Basically, I have a simple JSON CMS tool that lets developers store do...

mongodb for django

I like mongodb and django,and there are some frameworks to select: mongodbengine django-mongodb-engine Mongodbengine has good performance and django ORM like api,but when serialize ,it's not supported now. Django-mongodb-engine is a django backend,you can use it with django ORM. So django-mongodb-engine is better? and how about its...

What NoSQL solution is best to store Apache error_log and access_log? Cassandra or MongoDB?

We have developed PaaS solution for PHP. As part of that we offer developers to see Apache error_log and access_log files through our API. Currently we write the logs into files on disk seperated per deployment (vhost). Since this doesn't scale too well with a higher number of nodes and deployments, even though files are on distributed...

Mongo one to many relation and update problems

Hi guys, I'm implementing blog based on MongoDB. Let's look at first how Mongo guys recommend us to store blog post and its comments (http://www.mongodb.org/display/DOCS/Schema+Design): posts should be a collection. comments should be embedded objects within a post for performance. I found that it is very difficult to edit or just ...

When to use Singleton vs Transient vs Request using Ninject and MongoDB

I'm not quite sure when I should use SingletonScope() vs TransientScope() vs RequestScope() when I do my binding in my global.cs file. I have for example my call to MongoSession (using NoRM and the mvcStarter project http://mvcstarter.codeplex.com/) which is set to SingletonScope but I created a repository that use this MongoSession obj...

Raw Binary Tree Database or MongoDb/MySQL/Etc ?

I will be storing terabytes of information, before indexes, and after compression methods. Should I code up a Binary Tree Database by hand using sort files etc, or use something like MongoDB or even something like MySQL? I am worried about (space) cost per record with things like MySQL and other DB's that are around. I also know that ...

MongoDB and Authlogic, any gotchas? (mongomapper)

Authlogic, by itself, seems to be too active record centric for MongoDB (specifically mongomapper) as per: http://github.com/binarylogic/authlogic/issues#issue/15. However, there's an interesting authlogic plugin for mongo that looks pretty awesome, and simple. Has anyone used this, or have any experience/recommendations for an authlo...

Delete everything in a MongoDB database

I'm doing development on MongoDB. For totally non-evil purposes, I sometimes want to blow away everything in a database—that is, to delete every single collection, and whatever else might be lying around, and start from scratch. Is there a single line of code that will let me do this? Bonus points for giving both a MongoDB console method...

MongoDb NoRM Linq issue

I'm trying MongoDB with NoRM in C# and can't figure out why my LINQ queries don't work. Something as simple as this: How can this return all documents with all the fields/properties populated: return Collection.FindAll().Documents.ToList(); but this one only returns the correct number of documents with only the ID field popul...

Storing Embedded Comments vs. Avoiding overhead in MongoDB

Hey Everyone, Let me explain my problem, and hopefully someone can offer some good advice. I am currently working on a web-app that stores information and meta-data for a large amount of applications. For each application there could be anywhere from 10 to 100's of comments that are tied to the application and an application version i...

NoSQL - MongoDB vs CouchDB

I am a complete noob when it comes to the NoSQL movement. I have heard lots about MongoDB and CouchDB. I know there are differences between the two. Which do you recommend learning as a first step into the NoSQL world? ...

MongoMapper docs

Does anyone have a good resource for MongoMapper documentation? I've been reading through the mongoDB docs, but a lot of it doesn't convert across to ruby/mm. I've been trying to figure out how to do a SELECT FROM WHERE EXISTS with little success. db.things.find( { a : { $exists : true } } ); // return object if a is present The only ...