[01:11:51] <AWizzArd> I have one collection of 73 mio docs. I installed an ensureIndex({url: 1})
[01:11:53] <AWizzArd> Now I am running `db.coll.count({url: {$regex: /^http:/i}})` and this takes a veerry long time.
[01:11:56] <AWizzArd> Is this line of thought right: when all 73 mio URLs start with "http:" then having an index won’t help. Mongo has to iterate through all 73 mio entries on disk to count them.
[01:20:58] <kexmex> AWizzArd: cause case insensitive i bet
[01:21:34] <kexmex> why dont you lowercase then before you insert
[01:22:22] <kexmex> also, can't you do db.collection.count({url:/^http:/})
[01:24:58] <AWizzArd> kexmex: I didn’t know this kind of notation, this {url: /^http:/} - I guess this is syntactic sugar for the regex version I used above?
[18:13:29] <bros> https://gist.github.com/anonymous/e626592f1e2834bb3749 I can't get update $push to work.
[18:13:56] <OmicroN_> maybe someone in here can help me, fairly new to mongodb, trying to make a query that'll return all documents UNLESS a specific document by id exists then it'll just return that one
[18:23:01] <OmicroN_> was thinking if i could use a and/or and have two conditions in my query one to look for the specific id, the other condition to basically pull all records
[18:23:23] <OmicroN_> and if the condition to pull the specific id pulls before the other condition then my findone query will still pull the first record
[18:23:51] <OmicroN_> BUT i also sort based on a point system
[18:24:24] <OmicroN_> so if my specific id condition would of pulled first before the condition to pull all, the sort would still throw it off if the specific id condition doesn't have the highest sort
[21:08:33] <Guest51704> but once I look at the record the items in that ‘ItemsToRemove’ array have not been remvoed
[21:10:14] <gaby__> Hey guys, I am quite new to mongodb and I have this question about updating nested documents. Got a gist there with the concern and a code sample : https://gist.github.com/gabriel-dehan/09d94c7b5e8ab6496c1d
[21:40:52] <gaby_> Hello guys, kinda new to mongodb and have a question about updating nested documents. Everything is in the gist : https://gist.github.com/gabriel-dehan/09d94c7b5e8ab6496c1d
[22:08:04] <Guest51704> $pull should remove a single item from my array but it does nothing
[22:08:14] <gaby_> Maybe it is then I might have miss understood how it works. It seems to help to refine the query to get the document, but how does it allow me to update a nested object according to its fields ?
[22:13:51] <Guest51704> ah ok. Im a little confused as I am not doing a {b:1, c:1}
[22:14:42] <Guest51704> I thought Im just finding the ‘ItemsToDelete field (its an array) on my user doc, then $pull any sub fields that match the placeId
[22:15:30] <Guest51704> error I receive when doing “ItemsToDelete.placeId” => ‘cannot use the part (ItemsToDelete of ItemsToDelete.placeId) to traverse the element’
[22:19:38] <Guest51704> joannac: yeah seems It errors out when trying to do ‘ItemsToDelete.placeId’
[22:23:55] <Guest51704> joannac: i didnt on the test but yes on the gist, gist is updated
[22:25:54] <Guest51704> joannac: so yeah with quotes I still get that ‘cannot use the part (ItemsToDelete of ItemsToDelete.placeId) to traverse the element’
[22:26:43] <Guest51704> joannac: I have also updated the gist with the full error
[22:28:58] <joannac> wow, $pull is the one exception to that rule