MongoDB MongoDB is a widely used, general-purpose database. It is open-source, written in C++, and document-oriented. MongoDB has a strong support for MapReduce and uses BSON (Binary JSON) format for storage purposes. MongoDB supports different languages with a wide range of drivers. The latest ...
0
votes
0answers
10 views
Saving document with embedded documents containing ObjectID Reference
I'm using mongoose to implement the following data models:
var PostSchema = new Schema({
comments : [Comments.schema]
}, {collection:'order'});
var PersonSchema = new Schema ( {
name ...
2
votes
0answers
20 views
Mongo-Hadoop simple test failing with NPE
This is an open issue posted in the support forum here but since I didn't get any response, I thought I should try asking here.
I have an existing application that uses MongoDB as the
data layer. ...
1
vote
0answers
19 views
mongo db skip takes too long time
I created a simple test:
> db.t.count()
7852054
> db.t.find().skip( 1500000 ).limit(1)
{ "_id" : ObjectId("4fc078aa82618808f416e372"), "value" : 1500000 }
>
To do paging using skip and ...
0
votes
0answers
28 views
Parsing query in codeigniter
i need help about how to check patern in some query and how to make parsing in CI, this some sample query of nosql that the patern i want to check so i could make parsing out of it
db.users.find({}, ...
0
votes
2answers
14 views
Grouping Related Types of Documents in MongoDB
Ok I am totally new to MongoDB and started reading MongoDB Definitive guide book.
I am on page 7 and it says: "Group Related types of Documents together"
I don't get it :( a document is something ...
0
votes
1answer
18 views
Sane defaults for MongoDB on OSX?
I installed MongoDB and have set it up like so:
DB path: /data/db
System-wide config file: /usr/local/mongodb/mongod.conf
launchctl plist: /Library/LaunchDaemons/org.mongodb.mongod.plist
Log: ...
0
votes
2answers
33 views
How to get a child of a mongo collections by the key?
I ve got a collection users that look like this :
{
_id: myid,
name : 'blabla',
ia : {
[0]-> 'an id',
[1]-> 'a second id'
}
}
And i want to have only my first id of ia, so ...
0
votes
2answers
19 views
$addToSet for hashes?
$addToSet seems to add to arrays only, is it possible to add a hash to a hash?
{
"a"=>"1",
"b"=>"2",
"c"=>{"d"=>"3"}
}
to
{
"a"=>"1",
"b"=>"2",
...
0
votes
1answer
15 views
MongoDB Ruby atomic additive update issues
coll.save({"_id" => "test", "1" => "a"}) #=> {"_id"=>"test", "1"=>"a"}
coll.update({"_id" => "test"}, {"$set"=>{"1.2" => "b"}}) #=> {"_id"=>"test", "1"=>"a"}
I was ...
1
vote
2answers
22 views
PHP - Creating Json with Numeric Keys for Mongo Insert
Currently I'm attempting to simulate hours of the day with my keys for inserting into Mongo and I have something along these lines (simplified) setup:
for($i=0;$i<23;$i++){
...
0
votes
1answer
17 views
Fetching Documents from Mongo Collection using Karras
Let's assume that I have a collection in mongodb, where all of its documents take the following structure.
{
"_id":5,
"key-name":"test",
"meta-data":{
"user-id":2,
...
-1
votes
2answers
37 views
How do I query for strings with spaces using dot notation in mongo?
I have a subobject in a mongo database with fields that contain spaces, something like:
{name: "John Doe", subdata: {"Field 1": "Something", "Field 2": "Something else"}}
From what I've been able ...
0
votes
1answer
21 views
Bug with updating multiple documents with $inc in MongoDb?
I have encountered strange behavoir while testing my application.
I have a request to update multiple documents and increment one of thier fields by 1 (and also decrease other by -1, but dont think ...
0
votes
2answers
34 views
incorrect JARs for Casbah in Scala?
import com.mongodb.casbah.Imports._
val newObj = MongoDBObject( "abc" -> 1, "def" -> 2 )
This gives me the following error:
"class file needed by ValidDateOrNumericTypeHolder is missing. ...
1
vote
1answer
14 views
combining regex and embedded objects in mongodb queries
I am trying to combine regex and embedded object queries and failing miserably. I am either hitting a limitation of mongodb or just getting something slightly wrong maybe someone out ther has ...