[03:29:07] <steinen> whats the preferred backup method for a single instance (no replica sets etc) just mongodump + scp to a remote server or use the os ot perform snapshots and use the data files?
[06:46:37] <chetandhembre_> I have one shard with 100 GB and other with 10 Gb .. How much time require to balance data between two shard ? is it good idea to have this things in cluster ?
[07:21:41] <joannac> chetandhembre_: dunno, monitor the logs and sh.status() to see how the migration is progressing
[11:33:53] <hemangpatel> modulus^, I think that's not possible
[11:37:13] <modulus^> db.collection.find( { $query: {}, $orderby: { age : 1 } } <--- that will sort by age in ascending values of age
[11:39:15] <steinen> is there a nice way to keep a count field in a document which refers to the number of documents of a particular type in a separate collections? eg have a cars document with a number field that gets its value from the automobiles collection which has a number of docs with type: car
[11:40:17] <steinen> have the number field in the cars doc be determined by a count query somehow
[11:54:59] <modulus^> hemangpatel: you can try this too: db.collection.find().sort( { $natural: 1 } )
[12:05:23] <chetandhembre__> can i delete _id_ index in favour of _id_hashed ?
[12:07:19] <Naeblis> Is there any way I can ensure that the { field: _id } for my query should return if and only if the document with _id exists?
[12:07:54] <Naeblis> I have some bad data so documents have a field: id but the corresponding objects aren't there. I want to filter those out in my query
[12:08:25] <Naeblis> I tried $exists: true, $ne: null, but I suppose that only checks for the "id" field itself, not the related document
[12:09:12] <basiclaser_> are there any free storage sites where i can keep a mongoDB?
[12:09:39] <basiclaser_> i made a browser plugin that needs one, but I dont want to really pay for it until i know people are going to use it
[12:37:43] <steinen> if I run an insert or remove can I be guaranteed that in the callback function that the inserted/removed documents willl be reflected in any queries that I run from the callback?
[12:38:24] <steinen> or might they be staged to be written and I get uncertain results from queries in the cb
[12:40:01] <steinen> if I want to run a count query for example after inserting/removing
[16:29:00] <biggies> cheeser well i doing this http://pastebin.com/30DydhJH when i want to add more items to that records than it just replacing the currently i created
[16:29:43] <biggies> cheeser i want to create more "records" not allways change the existing.
[16:30:10] <cheeser> $set will replace anything that's there already.
[16:37:20] <biggies> cheeser i just asking if i'm right
[16:38:08] <cheeser> arrays are typically wrapped in []. in the mongo shell that's how you'll see them.
[16:38:38] <biggies> cheeser however when i trying to go with 'dots' like $push records.chata it does not work because chata is not created already.
[16:39:21] <biggies> cheeser my point is to save my custom array indexes like records {chata: array, mynextindex : array} i don't want 0,1,2,3,4 this creating $push
[16:39:32] <cheeser> if you try in the shell, i can help you. i can't help you with the php syntax because i don't know php
[16:46:55] <biggies> cheeser db.test.insert({username:'alex', records:[ ]}); ok how i can with update add to records:[ ] new arrays like records:[ chata:[], chatadole:[] ] ? this is shell commands.
[16:47:37] <cheeser> records wouldn't be an array then. it'd be a (sub)document.
[16:48:00] <cheeser> then you could just $set records.chata and records.chatadole
[16:54:13] <biggies> cheeser why i can't find my record by _id db.users.findOne({_id:'549d8e3348177e2f098b456b'}) ?
[16:54:38] <biggies> cheeser returns null but it exists
[16:54:39] <cheeser> because _id is probably not a string but an ObjectId
[16:54:58] <biggies> cheeser so i can write it in there objectId ?
[17:46:01] <ilhami> what is it that you are trying to do?
[17:46:19] <biggies> ilhami when i want to create in mongodb a field 'records' to be a subdocument i doing records: {} ?? and when i want records to be array i do records : [] ?
[17:47:37] <ilhami> {} this is bascially an object
[17:50:03] <biggies> ilhami yea and i will find out how to do it in php when i doing $array['records'] = array(); it is basically [] in mongodb but when i want create a new object .. {} i dont know how in php.
[17:54:17] <biggies> ilhami maybe i should create json format and decode it to arrays
[18:18:08] <GothAlice> biggies: On the array/subdocument thing, and I hesitate to mention this, but behind-the-scenes arrays _are_ stored as mappings. http://bsonspec.org/spec.html < see the first note here.
[18:20:00] <GothAlice> I shudder to think of what happens when you $pop a value… one assumes all elements after the popped one(s) are re-numbered. That further encourages me to make stack operations truly stack-like; push/pop on the right for best performance.
[18:23:04] <GothAlice> biggies: PHP treats "lists" and "mappings" as the same thing—both are array(). PHP refers to mappings as "associative arrays" and uses a slightly different syntax when constructing them. Oddly they introduce mappings first in the documentation: http://php.net/manual/en/language.types.array.php — example 4 is the first one treating them as a list. Interestingly, PHP treats lists and mappings in roughly the same way BSON does, though
[18:23:05] <GothAlice> MongoDB does differentiate them.
[18:24:56] <biggies> GothAlice but in json u can do array : [] and object : {} in arrays u can not do this .
[18:27:07] <biggies> GothAlice and can i create a object in arrays ? so i basically have a subdocument in mongodb i mean "{}"
[18:30:20] <biggies> GothAlice u know what i mean in mongodb i can do this : "db.users.insert({ name:'kokot', ob:{} })" how i can do this in arrays i mean when i do array('name'=>'kokot', ob=>array()) this is not the same as ob will be [] (array) not {} (object) in mongodb
[18:49:15] <GothAlice> biggies: You might be able to create a temporary variable of an array containing a single named value, then delete the named value. However, this is an usual approach. One generally never wants, nor needs, an empty subdocument.
[18:51:16] <GothAlice> (And that temp var approach is a hideously ugly unforgivable hack. ;)
[18:51:31] <GothAlice> (If it even works. I don't PHP. ¬_¬)
[18:57:00] <biggies> GothAlice dear Goth i realized now what u wrote i get it now ... thanks in bson , json basically list are arrays and mapps are objects :)
[22:44:08] <mcgullen> Thanks. I understand that morphia's move from 0.107 to 0.108 removed some deprecated methods. I don't think the update method on BasicDAO is one of them, and that's what seems to be causing the compilation error. Pastebin: http://pastebin.com/H6Ay8CzS
[22:46:10] <_roland> Is there a way to project the array index in the results of the $unwind operator in an aggregation pipeline?
[22:48:14] <cheeser> mcgullen: the generic parameter was removed because it wasn't actually used.
[22:57:55] <mcgullen> cheeser: thank you for pointing me to the right direction. If I remove the generic parameter from UpdateResults, the compilation error would read: cannot find symbol, variable results of type UpdateResults. Eclipse would also complain that it should be parameterized. This is confusing, because the compilation error shows in maven compiler, not eclipse...