175,439 questions
4
votes
2
answers
3k
views
When to use Embedded Documents?
I am trying to figure out how to layout my database for a site I am working on. Here are my models:
class User
include MongoMapper::Document
// keys here
many :items
many :likes
end
class ...
4
votes
3
answers
6k
views
Compressing a hex string in Ruby/Rails
I'm using MongoDB as a backend for a Rails app I'm building. Mongo, by default, generates 24-character hexadecimal ids for its records to make sharding easier, so my URLs wind up looking like:
...
55
votes
6
answers
7k
views
Are MongoDB and CouchDB perfect substitutes?
I haven't got my hands dirty yet with neither CouchDB nor MongoDB but I would like to do so soon... I also have read a bit about both systems and it looks to me like they cover the same cases... Or am ...
27
votes
4
answers
8k
views
Are there any tools for schema migration for NoSQL databases? [closed]
I'm looking a way to automate schema migration for such databases like MongoDB or CouchDB.
Preferably, this instument should be written in python, but any other language is ok.
82
votes
14
answers
21k
views
Mongoid or MongoMapper? [closed]
I have tried MongoMapper and it is feature complete (offering almost all AR functionality) but i was not very happy with the performance when using large datasets. Has anyone compared with Mongoid? ...
6
votes
2
answers
3k
views
Logical OR for two different fields in $where queries in mongodb
How do you do a query like the one below, where I want hotels in London OR hotels which have hilton in their name?
This query
db.hotels.find({$where : "name = /hilton/i || city = /london/i"})
...
1
vote
1
answer
1k
views
Is MongoDB as efficient as a RDBMS with reporting style queries?
I know that MongoDB is a document style database so queries like select all employees with salary > 32000 aren't its speciality, but I noticed that you can indeed do things like this. My question ...
4
votes
2
answers
3k
views
How do you do an AND query on an array in mongodb?
I have an array with tags which is part of a document, eg
["red", "green", "blue", "white", "black"]
Now I want to find all documents, which have red AND blue.
4
votes
2
answers
708
views
NO-SQL reliable for small business app?
I'm deciding between go for a NON-SQL engine or a regular SQL one for a document managment system for small bussines.
I have experience with firebird/sql server and found a good track of reliability (...
19
votes
3
answers
5k
views
Is SimpleDB similar to MongoDB? Are they both key/value type databases?
Is SimpleDB similar to MongoDB?
4
votes
3
answers
5k
views
Running MongoDB with Authentication
I am trying to figure out MongoDB in order to evaluate whether it is a route I would like to take for future applications or not. In order to deploy it sensibly on my server, I would have to run it ...
0
votes
1
answer
584
views
Access DB Ref MongoDB
Whats the best way to access/query a DB Ref:
UPDATE:
users: name, groupref : {$ref:"groups",$id:"ObjectId ..." } }
groups: name, topic, country,...,..
Assumption is that user belongs to only one ...
414
votes
30
answers
492k
views
MongoDB: Is it possible to make a case-insensitive query?
Example:
> db.stuff.save({"foo":"bar"});
> db.stuff.find({"foo":"bar"}).count();
1
> db.stuff.find({"foo":"BAR"}).count();
0
8
votes
2
answers
9k
views
MongoDB nested sets
What're the best practices to store nested sets (like trees of comments) in MongoDB?
I mean, every comment can have a parent comment and children-comments (answers).
Storing them like this:
{
...
1
vote
3
answers
751
views
MongoDB dbref in perl
Is there a way to do dbrefs using the Perl API? Its not here nor is it anywhere here.
Here s a sample schema:
book: name, publisher,isdn,{author}
author : name,date of birth
I could just add a ...
14
votes
5
answers
2k
views
I need an advice about NoSQL/MongoDb and data/models structure
Recently I'm exploring NoSQL Databases. I need an advice about how to store data in the most optimal and efficient way for a given problem. I'm targeting MongoDB, now. However it should be the same ...
19
votes
5
answers
7k
views
Middleware for MongoDB or CouchDB with jQuery Ajax/JSON frontend
I've been using the following web development stack for a few years:
java/spring/hibernate/mysql/jetty/wicket/jquery
For certain requirements, I'm considering switching to a NoSQL datastore with an ...
0
votes
1
answer
795
views
Grouping by Nested Object Keys in MongoDB
Is it possible to group results by a key found in an array of objects in a list?
For example, lets say I have a table of survey responses (survey_responses), and each entry represents a single ...
11
votes
2
answers
9k
views
Using Sinatra and MongoDB - what's the recommended way to "keep alive" the mongodb connection between http requests?
I've used ASP.NET and now I'm working on a Sinatra/MongoDB app. With ASP.NET architecture, the connection to the database a given request uses comes from a pool of connections that the ADO.NET ...
23
votes
9
answers
6k
views
MongoMapper and migrations
I'm building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model:
class SomeModel
include MongoMapper::Document
...
2
votes
2
answers
2k
views
MongoDB takes long for indexing
I have the following setup:
Mac Pro with 2 GB of RAM (yes, not that much)
MongoDB 1.1.3 64-bit
8 million entries in a single collection
index for one field (integer) wanted
Calling .ensureIndex(...) ...
0
votes
1
answer
434
views
Mongodb and indexing
Two questions:
If I remove all the data inside a collection (db.mycollection.remove({})) will the indexing information I created previously be lost?
How often (how many more entries must I have) ...
1
vote
3
answers
667
views
mongodb, pymongo querying
I've been browsing through the documentation, but I can't seem to figure out a way to perform a find on my mongodb collection using only a key.
For example, let's suppose this is what's inside my ...
206
votes
13
answers
445k
views
MongoDB: How to update multiple documents with a single command?
I was surprised to find that the following example code only updates a single document:
> db.test.save({"_id":1, "foo":"bar"});
> db.test.save({"_id":2, "foo":"bar"});
> db.test.update({"...
-1
votes
3
answers
881
views
Storing and accessing large amounts of data
My application creates pieces of data that, in xml, would look like this:
<resource url="someurl">
<term>
<name>somename</name>
<frequency>somenumber</...
1
vote
1
answer
596
views
How to run this query in mongodb?
My doc has an array field Keys
Keys1 and Keys2 are two arrays
I want all the docs where Keys contains any value in Keys1 AND any value in Keys2
26
votes
1
answer
15k
views
using sphinx search with mongodb as datasource
We decided to use mongodb for some web application (instead of mysql) but want to stay with sphinx for indexing/searching all data stored in mongodb. as the mongodb object-id is a hash per default -- ...
40
votes
4
answers
16k
views
Storing Directory Hierarchy in a Key-Value Data store
What is a clean/efficient method for storing the directory Hierarchy/tree in a Key-Value database (in my case MongoDB but any of them)?
For example a tree structure
- Cars
+ Audi
+ BMW
...
5
votes
5
answers
1k
views
Document based database for .NET [closed]
I would like to use some kind of nosql database in my web application which is written in asp.net mvc , but cannot find anything useful. I have a looked at MongoDB and CouchDB but i'd like to have ...
5
votes
1
answer
2k
views
Which is the most suitable Key-Value Store for a RDBMS background person?
Is there a distinct winner among all the key-value stores? Cassandra, MongoDB, CouchDB? and do they all follow some central guidelines? or they all have their own say in defining their APIs.
I'm ...
530
votes
10
answers
128k
views
When to use MongoDB or other document oriented database systems? [closed]
We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, ...
4
votes
4
answers
3k
views
Custom storage system for GridFS (MongoDB)?
Can anyone point me to any projects/django apps that provide a plugable custom storage system so I can use GridFS with Django to store file uploads?
I've found django-mongodb but it doesnt seem to ...
8
votes
6
answers
5k
views
Symfony (PHP framework) and MongoDB ( or any json-based database) [closed]
I was wondering if its possible to use a json-based schema-free, document-based database like Mongodb or Couchdb on a symfony project like its used for ruby-on-rails websites? And if yes, how can it ...
20
votes
5
answers
42k
views
Unique IDs with mongodb
If I were building a blog I could use the blog title as the unique identifier and parse it through the URL. However, what if I wanted to use numbers. You know how twitter has www.twitter.com/username/...
1
vote
1
answer
504
views
MongoDB and visual C++ 2008 linker errors
i'm trying to get the c++ client for mongodb working in visual studio 2008. i can reference the includes, but whenever i tell the linker about the mongodb .lib file i get the following error: "fatal ...
15
votes
2
answers
25k
views
Updating nested documents in mongodb
Say I have a data structure something like this:
{
'name': 'test',
'anotherdoc': {
'something': 'someval',
'somenum': 1
}
}
Now, say I wanted to set something. Initially, ...
485
votes
19
answers
132k
views
MongoDB or CouchDB - fit for production? [closed]
I was wondering if anyone can tell me if MongoDB or CouchDB are ready for a production environment.
I'm now looking at these storage solutions (I'm favouring MongoDB at the moment), however these ...
27
votes
7
answers
43k
views
Databases using JSON as storage/transport format [closed]
How many database systems there are that use JSON for storage or transport? I know of:
CouchDB
MongoDB
DBSlayer
I remember I saw yet another vendor in a SO user's profile. That systems was using what ...
39
votes
5
answers
13k
views
Django Sessions
I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?