PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 23rd of December, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:02:43] <Bilge> Take a tutorial in pastebin
[08:25:19] <OmidRaha> Hi, when i try to dump system.profile with `mongodump`, because of `$` in key of some queries that stored in `system.profile` dumping failed
[08:27:46] <OmidRaha> and also copyTo is failed:
[08:27:56] <OmidRaha> mongos> db.system.profile.copyTo("s")
[08:27:57] <OmidRaha> Sun Dec 23 11:30:27 uncaught exception: {
[08:27:57] <OmidRaha>     "errno" : -3,
[08:27:57] <OmidRaha>     "errmsg" : "invoke failed: JS Error: uncaught exception: field names cannot start with $ [$inc]",
[08:27:57] <OmidRaha>     "ok" : 0
[08:27:57] <OmidRaha> }
[10:40:45] <simply-chris> Hello, you have a typo on the DOCS link
[10:40:58] <simply-chris> http://docs.mongodb.org/manaul/administration/production-notes should be http://docs.mongodb.org/manual/administration/production-notes
[10:41:24] <simply-chris> on http://www.mongodb.org/display/DOCS/Home
[10:42:22] <simply-chris> 
[10:44:20] <simply-chris> Where should I report this?
[12:42:57] <salty-horse> hey. given a collection with documents like {data:[ {a:1, b:2, c:3 }, {a:10, b:2, c:30 }, ...]}, is there a way to query for the documents that have a 'data' subdocument that fulfills both a=1 AND b=2? -- the 'regular' approach gives me documents with two subdocuments: one that satisfies a=1 and one that satisfies b=2.
[12:45:07] <mids> salty-horse: http://docs.mongodb.org/manual/reference/operators/#_S_elemMatch
[12:45:58] <salty-horse> o_o -- I thought I'd gone through all the operators :D -- thanks!
[14:02:52] <salty-horse> is there a way to combine $in with $elemMatch? give a list of tuple-like objects, I'd like to find all objects whose subdocument $elemMatch's them -- do I have to split it into separate queries?
[14:03:09] <bigmeow> hi all
[14:03:51] <bigmeow> meow:)
[14:03:55] <salty-horse> there's a feature request open: https://jira.mongodb.org/browse/SERVER-3544
[14:04:22] <bigmeow> it is really boring to query collections in one db:(
[14:04:37] <bigmeow> i should type so many characters(
[14:04:45] <bigmeow> angry:(
[16:17:39] <gheegh> Hi all.. question. Does it make sense that I have a problem with my _id index.. if I try to find documents and sometimes it can find them and sometimes it can't?
[16:22:09] <wereHamster> gheegh: do you have examples?
[16:26:30] <bigmeow> hi :)
[16:26:47] <gheegh> wereHamster: I'm using ruby (Mongoid), so the code examples are there. . I have one process that misses about 50% of the time finding the document, but if I load the console.. and query it.. i hit it 100% of the time. Putting a gist together
[16:27:21] <bigmeow> how to remove mongo command history?
[16:28:01] <gheegh> wereHamster: https://gist.github.com/388c8a160dea7531247b
[16:28:30] <bigmeow> gheegh: pardon?
[16:29:02] <gheegh> so, in the first case, I am querying it.. and getting a raised exception of document not found.. (i retry it a number of times).. in the second case, I query it from my rails console.. and it retrieves just fine.. same command. One time hit hits, one time it doesn't
[16:29:44] <gheegh> bigmeow: Sorry.. i had asked a question earlier about indexes.. whether my :_id index could be messed up.. and that would cause a collection to not return simple finds randomly..
[17:00:30] <millun> hi, can i ask why i am getting IllegalArgumentException: can't serialize class ?
[17:01:06] <millun> i am using morphia, but retrieving data via mapper in this case
[17:16:16] <millun> doh, sorry. my bad
[17:30:55] <silverfix> hello guys
[17:31:33] <silverfix> I'm experiencing this error: > db.labeler.find().max()
[17:31:46] <silverfix> error: { "$err" : "assertion d:\\slave\\windows_64bit_2008+_v2.2\\mongo\\src\\mongo\\db\\../bson/bson-inl.h:183" }
[17:31:52] <silverfix> any hints ?
[17:35:31] <silverfix> that is, i can use .max & min without parameters?
[17:42:58] <silverfix> How do I can get the greatest document on a collection by a field ?
[17:46:53] <LesTR> silverfix: db.collection.find().sort("field").limit(5) ?
[17:47:09] <salentinux> hi guys. I'm struggling make those statements to work: var x=db.coll1.find({field1:7},{_id:0,field2:1}); db.coll2.find({field1:3,field2: {$in: x}});
[17:47:56] <salentinux> I'd like to have x as an array in order to pass it to $in operator. is it possible?
[17:48:43] <silverfix> LesTR: thank you :)
[17:49:00] <LesTR> np
[18:01:21] <Tixz> Is there an atomic operator to set a field equal to the length of an array in a document?
[18:03:57] <mids> no, but if you $push stuff onto it, you could $inc the length field in the same update
[18:04:02] <Tixz> I currently do the following in the mongo shell: db.col.find().forEach(function(doc){ doc.arrLength = doc.arr.length; db.col.update({_id: doc._id}, doc); }); but I can't do this from my driver. How do I get around this?
[18:04:25] <Tixz> mids: My array is a set however, only containing unique values so $inc will not work
[18:06:43] <mids> you could make a server side function and call that from your driver
[18:06:55] <mids> but what do you need the length field for?
[18:07:11] <Tixz> Yes, but then I have to pull out ~100k rows just to update the length field :)
[18:07:38] <Tixz> It's used to then calculate some statistics on the dataset (mean, variance, max, min etc.)
[18:07:54] <Tixz> the stats are calculated by a Map-Reduce
[18:08:13] <mids> no need to pull 100k; http://docs.mongodb.org/manual/applications/server-side-javascript/
[18:08:30] <silverfix> is there a way to use hint with distinct ?
[18:09:03] <Tixz> mids: Arr misunderstood what you meant :)
[18:09:11] <Tixz> mids: Will have a look at it
[18:20:39] <Tixz> mids: Which driver do you normally use? I'm working with Node.js, but unsure of how to execute the functions from the driver
[18:20:59] <mids> pymongo
[18:21:18] <Papierkorb> Hello. I'm taking a look at MongoDb atm .. Lets say I have two collections, and use a one-to-many relation, which maps the collection Books to the collection Authors, how can I query all Books, whose Author name is "ABC"?
[18:21:28] <Tixz> Alright, thanks anyway :)
[18:21:52] <Tixz> Papierkorb: You wouldn't separate it that way in Mongo
[18:22:31] <Tixz> Papierkorb: You would probably just write the author directly in your Books documents and then query it that way
[18:22:34] <LesTR> Papierkorb: wellcome in nosql world : ) Here don't exists relations
[18:22:35] <Papierkorb> how should i do it in mongo? i mean, if i store much data for each author, I'd end up filling the database with repetive data
[18:22:44] <wereHamster> Papierkorb: http://www.mongodb.org/display/DOCS/Schema+Design
[18:23:05] <wereHamster> you'd store with the book only what you need to query. Like in your example the author name
[18:23:36] <wereHamster> and yes, you'll have some repeated data in your database
[18:23:41] <wereHamster> there's nothing wrong wiht that
[18:24:14] <mids> Tixz: https://github.com/christkv/node-mongodb-native/blob/master/lib/mongodb/db.js#L487
[18:24:16] <Tixz> mids: The serverside functions may not be an option with my driver :( Do you have any other ideas?
[18:24:57] <Tixz> mids: But eval forces a write/read lock :s
[18:25:02] <Papierkorb> well, no one cares about storing a id (or string if it acts like a id). but what if i later see, that my application needs to query for something which i haven't thought of at the beginning? update all objects in the collection?
[18:25:06] <mids> Tixz: yup, it sucks :)
[18:25:18] <wereHamster> Papierkorb: maybe
[18:25:27] <mids> Tixz: your mapper could calculate the length on the fly whenever they access the document
[18:25:42] <Tixz> mids: Arr, might be an option! Seems like theres a noLock parameter for my driver
[18:25:54] <wereHamster> Papierkorb: why are you trying to use mongodb if you have such highly relational data?
[18:26:00] <Tixz> mids: Thanks for looking into this :)
[18:26:29] <mids> Tixz: I use aggregation framework myself for statistics, but I dont think it can do variance (yet)
[18:26:30] <Papierkorb> wereHamster: because I like to look at other solutions, sometimes they turn out to be much better/easier
[18:26:47] <wereHamster> you have relational data. Use a relational database.
[18:28:01] <Tixz> Papierkorb: If you are serious about your Books > Authors example then most authors don't write that many books anyway
[18:28:24] <Papierkorb> wereHamster: Well, okay. thanks for the honest answer
[18:28:32] <Tixz> You'll have relatively few authors that are repeated more than 3 times
[18:29:03] <Papierkorb> Tixz: nah, not really ;) i'm about to begin writing a daemon which acts as a giant news/information aggregator to put it in really simple terms.
[18:29:27] <Tixz> Papierkorb: I actually did something similar with mongodb a while ago for Machine Learning
[18:30:08] <Tixz> Papierkorb: For that purpose most of your data will vary from provider to provider so I guess mongo might be a good fit
[18:31:59] <Papierkorb> Actually, it's hard to say. the entire system is aimed to be flexible to no avail with complex database queries all the time (issued by some other application). i really have no idea what the user might want to query/search for and i really don't want to restrict that
[18:32:58] <Tixz> Well one of the advantages of mongo is that queries support regex so you could on the frontend build as sophisticated a query system as you want to, as long as it can compile to regex
[18:33:49] <Papierkorb> yeah, regex support is nice. mysql supports it somehow and sqlite does using some module one can load.. that part scares me a bit, but okay.
[18:34:37] <Tixz> Well, I didn't work too much with any sophisticated search when I used MySQL but as far as I know it only supported wildcards
[18:34:53] <Tixz> But maybe it has something as powerful as regex that I don't know of
[18:36:06] <Papierkorb> Tixz: if you're interested, i could go a bit more into detail what i need later. if you're not thats cool, but then i don't have to write a novel about that ;)
[18:36:47] <Tixz> Well I'm intrigued :)
[18:37:45] <salentinux> which is the limit of the $in array operand ? How much bigger could it be?
[19:03:30] <salentinux> is there a way to free/release a variable?
[19:23:38] <millun> hi
[19:24:36] <millun> i was having a 'java.lang.IllegalArgumentException: can't serialize class' error, and now it started reappearing
[19:26:45] <millun> my POJO is ok, any other idea?
[19:30:06] <Tixz> salentinux: delete varName
[19:30:18] <Tixz> If you're thinking JS wise
[19:30:33] <salentinux> ok tnks tixz
[19:38:28] <Tixz> Derick: Can you do something about avalance123?
[19:38:50] <Tixz> mstearn: Can you do something about avalance123?
[19:43:16] <mids> Tixz: just ignore him
[20:25:07] <fommil> hi all – how can I get the index of a $sorted entry from a $group clause?
[21:10:42] <millun> http://pastebin.com/YnfnSAVv -- i get complaints about a @reference not being seriazible
[21:50:10] <millun> can i ask? is it ok for me to have a class called Record, then have RecordLost and Found extrend it?
[21:53:23] <millun> ... @entity being decorated with Lost, and Found.
[22:34:33] <mitsuhiko> why does my mongo router have journal prealloc files?