[04:22:18] <tim_t> hey all. how do I clear a collection using morphia API?
[04:23:08] <tim_t> like, with one call rather than say querying the collection and deleting by iteration?
[04:27:25] <tim_t> woo never mind. the solution is : ds.delete(ds.createQuery(entity.class));
[04:46:58] <smcguinness> i'm using geoNear and I'm getting results, however, as soon as I try to chain .limit and .skip, I'm getting an undefined error
[10:18:06] <Tomasso> the text search also works for arrays?
[10:58:27] <arussel> is there a way to do this http://docs.mongodb.org/manual/reference/operator/aggregation/concat/ but as result get "XYZ1" for _id 3 instead of null ?
[15:28:57] <bigx> I posted the question on SO if someone wants some rep points! http://stackoverflow.com/questions/28153168/mongodb-aggregation-with-project-to-conditionally-exclude-a-field
[16:45:39] <darkening> hi, i'm trying to update to mongodb 2.6.7 from mongodb 2.4.12 but seeing a severe performance degredation for a query. the query ran in a couple of milliseconds on 2.4 but now takes >60s to complete. i believe the query planner makes a poor choice, more details on indexes and query here: http://pastebin.com/x9B6spqL
[16:46:08] <oblio> cheeser: you mean the remaining chunk:?
[16:47:52] <cheeser> i mean the other chunks you're draining to
[16:53:51] <darkening> i added the explain from 2.4 as well: http://pastebin.com/Sca2c3qS ... i believe what is happening is that mongodb tries to use the "t_1" index for the $nin while not using the "s_1_t_1" index for both $in conditions but i'm not entirely sure about this
[17:07:43] <StephenLynx> a couple of ms to over a minute?
[17:08:32] <darkening> yes, 7ms to 71661ms ... i was shocked when i saw this
[17:09:53] <darkening> whats more, mongodb sucks 100% of one core while it's working on the query
[17:10:05] <StephenLynx> http://stackoverflow.com/questions/26351714/query-with-in-and-nin-doesnt-use-index see if this is the same issue you are having
[17:14:44] <darkening> sadly this links to https://jira.mongodb.org/browse/SERVER-12281 which might be fixed in 2.9 ...
[17:15:31] <StephenLynx> so you will have to either change your query or keep using the old version.
[17:27:55] <denym_> hey there short question about general mongo setup... I used brew and I can start it with a custom config... I added the path to the log file but I dont get any terminal output. Is it supposed to be like that?
[17:28:48] <digicyc> denym_: It's running as a daemon. use mongo and it's commands for status info.
[17:29:03] <digicyc> Unless you are expecting something else.
[17:29:28] <denym_> Usually when I run a daemon in foreground it outputs something :)
[18:50:42] <parallel21> But I'm not trying to unset only. I have a form with checkboxes, and when updating an item, unchecking a checkbox where all checkboxes are now unselected doesn't take effect
[19:02:09] <jumpman> unfortunately it seems like using $in on an empty array returns nothing
[19:02:19] <jumpman> but THAT'S OK, i can just modify my logic veeeery slightly
[20:29:17] <Dances> Question(Python3/MongoDB 2.6.1): I'm inserted datetime.utcnow() isntances like this mydict['date'] = datetime.utcnow() ... collection.insert(mydict), for some reason dates are getting stored as datetime.datetime instead of an ISODate object. How come? This works on my other mongo server no problem.
[20:33:51] <_newb> does anybody know if there's a mongodb equivilant to the mysql: DATE_FORMAT(FROM_UNIXTIME(timestamp),'%Y%m')
[20:35:34] <GothAlice> _newb: You'd just do that in whatever language you're using to write your application. MongoDB doesn't really have "server-side functions" like that.
[20:36:32] <GothAlice> _newb: datetime.datetime.fromtimestamp(timestamp).strftime('%Y%m') for example
[20:36:43] <_newb> GothAlice: even aggregate won't return a count of documents for each YYYYMM timestamp?
[20:37:40] <GothAlice> Well, yes, that's pretty much the exception here. You can $group on the values extracted from real dates via http://docs.mongodb.org/manual/meta/aggregation-quick-reference/#date-expressions
[20:38:35] <GothAlice> I.e. using {$group: {_id: {year: {$year: '$somedatefield'}, month: {$month: '$somedatefield'}}}} would work
[20:38:55] <GothAlice> But that only works on true date values, not UNIX timestamps.
[20:40:38] <_newb> GothAlice: I'm using timestamps, but i imagine the mongoid's timestamp will work?
[20:43:05] <GothAlice> _newb: Yes, but only really if you have a real date value. See https://gist.github.com/amcgregor/1ca13e5a74b2ac318017 for an example; this aggregates data per-day-of-the-week on the "h" field, which represents an hourly period.
[20:52:33] <oblio> cheeser: i'm not for sure how i would even specifically see that
[20:53:28] <oblio> cheeser: but the db i'm trying to move the stuff to has no moveChunk op running
[20:53:33] <oblio> it's like it failed and something didn't communicate
[21:02:47] <GothAlice> Hmm; I seem to have an interesting problem. If I store the "path" to a tree's leaf as a list of strings (i.e. ['foo', 'bar', 'baz']) I can easily mutate that list ($push, $pull, etc.) atomically, but I can't easily sort on it. If I store it as a coalesced string ('/foo/bar/baz') I can sort on it, but I can't atomically manipulate it. Ideas?
[21:03:51] <GothAlice> (Trying to optimize both the "all descendants" query and "attach" update which needs to handle moving whole sub-trees.)
[21:05:45] <_newb> GothAlice: your solution worked terrifically for me, thank you again for your suggestion.
[21:05:55] <GothAlice> _newb: It never hurts to help. :)
[21:07:00] <_newb> GothAlice: hehe.. so true. i wish i knew what advice to give for yours.
[21:10:40] <GothAlice> My kingdom for an atomic string prepend.
[21:33:00] <winem> hi, I have a quick question regarding the online courses. it says "build an index on the "active" and "tstamp" fields." << do I get this right and they mean a covered index?
[21:33:07] <winem> I'm not a native speaker so I just want to be sure before I complete the index... I'd expect "... build one index..." if they're talking about covered indexes, but as I said, I'm not sure
[21:35:07] <jumpman> winem: i have no answer for you. However, i'm trying to figure out how to support keyword seaching/text searching right now
[21:35:41] <jumpman> seems like from the verbage on the site you would want to start here: http://docs.mongodb.org/manual/core/indexes-introduction/
[21:36:05] <winem> I understand how they work and I'm really impressed by them. especially by the text index
[21:36:30] <winem> was just not sure if they ask for 2 indexes (1 per field) or 1 index that covers both. but it looks like they asked for the last one :)
[21:39:25] <winem> thanks jumpman. it worked with a covered one
[21:52:18] <plato1> is this a well formed query? i cant figure out why it returns no docs { timestampReported: { '$lt': 1421733600000, '$gt': 1421647200000 } }
[21:58:13] <joannac> plato1: it is. what do you expect it to match?
[22:02:23] <plato1> every doc in the collection with a timestamp property whose value is between those two numbers
[22:02:31] <plato1> *with a timestampReported property...
[22:22:04] <midnight_> hey, I've noticed that the ubuntu meta-package for 3.0.0-rc6 (mongodb-org) doesn't update the child packages when I run a simple "apt-get install mongodb-org"
[22:37:52] <UnNaturalHigh> Can someone here help me understand how Mongodb works with timezones with the pymongo client? Lets say I insert date1 in my collection with GMT offset -7 and then insert date 2 in my collection with GMT offset -6. I then query for date1 and date2, would the time of date1 and date2 be in my current timezone?
[22:52:50] <jayjo> Is it possible to define a field in a document that relies on another field? Eg, 'title' and then automatically create a 'url' field, both strings
[23:02:52] <kaiju_sloth> I have a few corrupted document in my collection and I'm having trouble identifying / removing them. Already tried repair db with no result. They cause breaks in my cursor streams. Any good suggestions?