PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 22nd of December, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:38:44] <[Fudge]> is there any way to set a limit to how many documents a collection can store?
[00:38:59] <[Fudge]> say if I put a limit of 5 on and had 5 documents in it
[00:39:03] <[Fudge]> then added another one
[00:39:15] <[Fudge]> that'd be added, the oldest one would be removed
[00:40:28] <algernon> capped collections come close, but not quite.
[00:40:32] <rekibnikufesin> there is a capped collection that works exactly as you describe- but it's limited by size- not number of records
[00:40:44] <rekibnikufesin> http://docs.mongodb.org/manual/core/capped-collections/
[00:40:45] <[Fudge]> oh, damn
[00:40:59] <[Fudge]> it'd be a nice feature though
[00:41:19] <algernon> hrm
[00:41:38] <algernon> capped collections can have a max setting, limiting it to number of documents
[00:41:43] <algernon> but you still need to set a size
[00:41:56] <algernon> though, if you set the size stupidly high, it will reach the max documents sooner, and voila
[00:42:14] <[Fudge]> so, how would you suggest I go about doing this?
[00:42:16] <algernon> http://docs.mongodb.org/manual/reference/commands/#create
[00:43:08] <algernon> create a capped collection, with max set to the number of documents you want, and size set to about the expected average size of documents, times max times 2-4 or so.
[00:43:38] <[Fudge]> mm
[00:43:58] <[Fudge]> thing is, I need to do this programatically and it'll rely on users setting it up
[00:44:19] <algernon> well, just set it to 8MB * max then or so :)
[00:45:36] <[Fudge]> algernon: thanks, I'll see how it goes :)
[08:51:53] <thewitcher> If i use mongo's inbuilt '$gte' operator on an integer against a database entry which is a floating point, and the result is returned as if i used '$gt' is this potentially because of the nature of floating point numbers?
[08:52:24] <thewitcher> Ive tested quite a few times and pretty sure that i dont understand somethign implicit about float datatypes here
[12:21:17] <fommil> Hi all – I need some help using the $first command in an aggregate. I want to use it to pick the first full result from the pipeline. The docs are sparse the examples seem to only use it as a way to filter by field
[12:27:08] <fommil> aaah! { $limit : 1 } :-)
[12:33:52] <Sri19> (node.js related) I've used MongoJS in the past .. not sure if its the best choice for my next project .. which mongodb libraries do you recommend?
[12:45:00] <fommil> is there a nice way to use $first in a $group which preserves all the fields of the pipeline (i.e. without having to explicitly list all the fields)
[13:37:02] <db42> I have an document with a field "blah" which holds an array of ObjectID, how do i find in a colleciton all documents which in the field blah, do not have a specific objectID ?
[13:40:20] <wereHamster> $nin ?
[13:40:27] <wereHamster> db42: ^^^
[13:41:00] <db42> i am a beginner
[13:41:10] <db42> could you give me the query line ? for db.acollection.find ?
[13:44:06] <wereHamster> {blah: {$ne: theObjectId} }
[14:04:34] <db42> wereHamster, hmm.. does not workSat Dec 22 16:03:37 SyntaxError: missing : after property id (shell):1\
[14:09:24] <db42> db.users.find({ friends: { $ne: {50d2246725ee153370000003}}}) <-- why is this a syntax error ?
[14:27:34] <mids> db42: might need quotes around that hex string
[14:27:42] <wereHamster> db.users.find({ friends: { $ne: ObjectId('50d2246725ee153370000003') }})
[14:27:55] <wereHamster> {50d2246725ee153370000003} is not valid javascript
[14:28:46] <db42> yeah, thanks, figured it already, now wondering on the syntax for mongoose
[14:29:02] <wereHamster> same
[14:32:05] <db42> nice, works fine :)
[14:32:30] <db42> can i ge tmongoose to populate a sub document with only a subset of the data ?
[15:21:16] <Faerelis> hello
[15:21:29] <Faerelis> someone out there?
[15:26:10] <Faerelis> maybe some can answer me a question. i made little diary prog with outsourced mongodb code and in the __init__ methode i connect everything, but how i can access correctly to the collecion? i write funtions und everytime i get this message: AttributeError: 'str' object has no attribute 'collection'.
[15:27:03] <Faerelis> (sorry for my bad english) how can i fix it, anybody a idear or a link?
[15:35:24] <db42> Faerelis, try checking the mongo shell ?
[16:14:05] <Faerelis> o damn, it works xD xD after 2 days
[16:14:26] <Faerelis> thx db42 :_)
[16:16:51] <db42> :)
[16:21:15] <mitsuhiko> hello guys
[16:21:28] <mitsuhiko> we put a bigger box into one of our replica sets as the primary since the majority of traffic hits it
[16:21:39] <mitsuhiko> we now have the curious case that everything has gotten slower on agerage
[16:22:00] <mitsuhiko> any hints on what might be causing this?
[16:22:07] <mitsuhiko> (it has not recovered over 10 hours)
[18:11:07] <Tixz> I have two fields in my collection that contain pretty much unique keys, however I do a lot of selection based on what values the arrays contain. Would a multi-key index be appropriate or unlikely to help?
[18:13:16] <Tixz> Sorry for the inconvenience, just checked with explain (didn't think of that) and it did help dramatically :)
[20:00:19] <eka> mitsuhiko: since you have a lot of traffic, did you think about sharding?
[20:04:04] <mrpro> whats large traffic
[20:06:55] <mrpro> [snapshotthread] cpu: elapsed:4000 writelock: 0%
[20:06:57] <mrpro> what is this??
[20:09:31] <mrpro> seems like c# driver keeps opening and closing a connection
[20:09:34] <mrpro> anyone has any ideas?
[20:52:15] <guitoun3> hi
[21:40:06] <guitoun3> someone use mongodb with java ?
[21:43:30] <ron> guitoun3: someone. yes.
[21:46:10] <guitoun3> Yes but here ^^
[23:31:36] <manouch_> hi... i have the following problem...
[23:31:36] <manouch_> http://pastebin.com/Yps4pmSz
[23:31:42] <manouch_> does anybody know what i can do?