mongodb

MongoDB query with an 'or' condition

So I have an embedded document that tracks group memberships. Each embedded document has an ID pointing to the group in another collection, a start date, and an optional expire date. I want to query for current members of a group. "Current" means the start time is less than the current time, and the expire time is greater than the cur...

MongoDB to store different (schema) log files

Do you think that using a MongoDB Json Database to store log files from application is a good idea and why ? The only advantage for me is the schema abstraction, but i think it's also a weakness we cannot ensure the integrity of a log file. ...

How would you implement a revision control system for your models in your prefered db paradigm ?

I found out that RCS for models is an interesting problem to solve in the context of data persistence. They are several solution using the django ORM to achieve this django-reversion and AuditTrail each of which propose their own way to do it. Here is the model (in django-model-like format) which I would like to have revisions : class ...

MongoMapper has_many association

I have problem with mongomapper associations. I have one class names User and other named Model. User has many models but... user = User.first => <User ... user.models => [] Model.find_by_user_id(user.id.to_s) => <Model ... Model.find_by_user_id(user.id.to_s).user == user => true Class code (simplified): class User include MongoMap...

How to replicate two different database systems?

I'm not sure, if it fits exactly stackoverflow, however as i'm seeking for some code rather than a tool, i think it does. I'm looking for a way of how to replicate / synchronize different database systems -- in this case: mysql and mongodb. We are running both for different purpose. We started with a mysql database and added mongodb lat...

Tracking system and real time stats analysis in Python

This question is related to an older question: http://stackoverflow.com/questions/2019096/mysql-tracking-system. In short: I have to implement a tracking system that will have high loads using Python. For the database part I've settled on mongoDB (which sounds like the right tool for this job). The development language will be Python. ...

Pagination with MongoDB

Hey, I have been using MongoDB and RoR to store logging data. I am pulling out the data and looking to page the results. Has anyone done paging with MongoDB or know of any resources online that might help get me started? Cheers Eef ...

Usage of MongoDB as a RDFStore for data objects.

Is there any tool to query MongoDB using SPARQL ? I store object using an RDF schema (boo Mongo no schema ^^), and now i looking for a tool/server to query the datastore using SPARQL. I started to write a SPARQL parser, but if such as tool exists, i think i would use it. Thanks in advance. ...

Mongomapper query collection problem

When I define the User has_many meetings, it automatically creates a "user_id" key/value pair to relate to the User collections. Except I can't run any mongo_mapper finds using this value, without it returning nil or []. Meeting.first(:user_id => "1234") Meeting.all(:user_id => "1234") Meeting.find(:user_id => "1234") All return nil....

Does MongoMapper (or any other Mongodb adapter) have a method like "accepts_nested_attributes_for"?

Hi there, I'm considering using mongodb on a new project, but before delving in, I'd like to know if it supports some key features. I know you don't need migrations, and you can add embedded objects,...but does all that mean it also behaves as if the 'accepts_nested_attributes_for' method is always there? Do you know of any other killer...

Exposing database query parameters via REST interface

I have the basics of a REST service done, with "standard" list and GET/POST/PUT/DELETE verbs implemented around my nouns. However, the client base I'm working with also wants to have more powerful operations. I'm using Mongo DB on the back-end, and it'd be easy to expose an "update" operation. This page describes how Mongo can do upda...

mongoDB, passenger and performance issues with phusion passenger

i just stumbled across a posing on the mongodb-user list where there was a discussion about passenger and forking when using mongoDB with MongoMapper. I just wanted to remind that Rails developers need to tweak their 'environment.rb' if they use MongoDB with Passenger. By default, Passenger spawns Ruby processes with fork(). A...

Inheritance with MongoMapper: searching the parent class

does it make sense to save the class name in a field when using inheritance with mongomapper/rails? class Item include MongoMapper::Document timestamps! key :class, String # does this actually make sense? key :title, String end class Post < Item key :body1, String end class Page < Item key :body2, String end if a sear...

:has_one relationship problem when using MongoDB

I have a pretty simple setup. To sum it up here's what I'm doing: class Movie include MongoMapper::Document has_one :setting end class Setting include MongoMapper::EmbeddedDocument belongs_to :movie end What I want to do is to update the setting of a movie in the same form as the movie other information. Therefor I do that : ...

Picking a database technology

We're setting out to build an online platform (API, Servers, Data, Wahoo!). For context, imagine that we need to build something like twitter, but with the comments (tweets) organized around a live event. Information about the live event itself must be delivered to clients as fast and consistently as possible, while comments about the ev...

What are the advantages of using a schema-free database like MongoDB compared to a relational database?

I'm used to using relational databases like MySQL or PostgreSQL, and combined with MVC frameworks such as Symfony, RoR or Django, and I think it works great. But lately I've heard a lot about MongoDB which is a non-relational database, or, to quote the official definition, a scalable, high-performance, open source, schema-free, do...

How to specify an Order or Sort using the C# driver for MongoDB?

I'm trying to figure out how to sort a collection of documents server side by telling the C# driver what the sort order is, but it appears not to support that construct yet. Is it possible to do this any other way? ...

Mongodb: What to know before using?

I'm starting a hobby (non-revenue) project using Ruby on Rails. I've done a fair amount of development in Rails using Postgresql, and I can make a pretty good imitation of normalized schema. However, Mongrodb looks shiny and new. What better for trying out something new than a hobby project? Think back to when you started using Mongo...

Order items in MongoDB according to the size of an array with MongoMapper?

I'd like to select a collection of items ordered based on the number of items within an array. Hopefully the following example will clarify my rather poor explanation: class Thing include MongoMapper::Document key :name, String key :tags, Array end I'd like to retrieve all Things ordered from those with the most tags to those w...

MongoDB Group using Ruby driver

I'm trying to bring back a list of year/month combinations with counts for describing blog posts. The idea is that they will be displayed like so: January 2010 (1 post) December 2009 (2 posts) ... I have managed to get this to work using the MongoDB JS shell, and it returns results in a useful format: db.posts.group({ keyf: fun...