[01:19:31] <haole> if most of my documents share, let's say, the same four fields, but some of them have extra unique fields to themselves, should I worry about optimizations upfront?
[01:19:36] <haole> I hope the question made sense :D
[01:41:21] <unholycrab> having an issue with mongodb 2.4.7 not storing utf-8 characters correctly
[01:41:35] <unholycrab> trying to dig up some more details
[01:41:46] <unholycrab> im not actually sure where in the pipeline its being stored like this
[02:13:35] <giowong> hi anyone here familiar with monk?
[05:36:27] <Boomtime> giowong: joannac is suggesting you try mongoimport, it can parse csv under strict conditions and make documents from each row, you may find it suits your needs
[07:47:04] <jerev> I have a date object in my data, that looks like {..., "dt": {"$date": "2015-10-02T15:15:00.000Z"}, ... } -- How do i match on this?
[07:47:28] <jerev> When I write a simple $match { dt { $gt: ... } } } it doesn't seem to give the correct results
[07:48:02] <kali> jerev: what do you put in place of the ... :)
[09:08:04] <durre> is it a bad idea to do querys like this: {authorId: {$in: [id1, id2, id3 ...]}} ... I expect the list to normally be around 30 ids and maybe at most 100-150
[09:12:03] <kali> durre: this is fine. certainly better than performing individual queries for each author
[09:12:04] <durre> and the collection will probably hold ~1 million documents
[09:12:45] <kali> you certainly need and index on authorId though
[11:27:52] <Faved> hey all, can anyone tell me, I am messing around with using TTL on some mongo indexes, but I wonder if there is a way to make them slide? so if I set a TTL of say 2 mins on doc when I add it, can I call something which will make the 2 min "reset" ?
[11:31:33] <kali> yeah. use a "death_date" with a ttl of 0
[11:32:23] <kali> just set the death_date in 10 minutes in the future (if that's the actual TTL you want) when you insert, and update it at 10 minutes in the future when you want to prolong your document life
[11:32:46] <kali> death_date is an arbitrary name, don't look for it in the doc
[11:33:48] <Faved> so using that technique, if i have a doc which is orginally set for say 5 mins, am I amble to prolong that ttl indefinitely.
[11:34:03] <Faved> I am using something using Redis at the moment and I am looking at using mongo instead
[11:34:11] <Faved> I store a user token for a ruby API
[11:34:26] <Faved> which is supposed to expire after 5 mins, unless there is some interaction
[15:04:32] <StephenLynx> but what does it has to do with mongo?
[15:04:43] <StephenLynx> hey, I was pretty sure I had you on ignore.
[15:08:37] <queretaro> Hi, I've created an admin user in a single DB but I noticed that I still can access the DB without any credentials, how could I restrict that to only the admin?
[15:12:36] <salty-horse> hey. is there a way to tell mongodb to only match documents whose list field contains all provided elements? the $in operator provides an OR relation. I'm looking for AND
[15:35:06] <jthomas_> Can anyone explain how to do that? I wanted to give more perms by rerunning the command but Mongo says the account exists (yes it does). Figured out how to drop the account, now I want to re-add it with userAdmin perms AND readWrite perms.
[15:35:21] <jthomas_> I have four different DBs for this user
[15:36:06] <jthomas_> looking at the docs, it seeems to tell me to change to the DB that I want to affect, and run the db.createUser() command, but then it starts granting roles in unrelated DBs http://docs.mongodb.org/manual/tutorial/add-user-to-database/
[15:36:41] <jthomas_> why do I change to a DB if the roles are for other DBs? Do I have to change to each of my 4 and grant perms to all the others within each of these?
[16:54:24] <kali> cypas: well, it depends how you access mongodb, but the driver interface should escape for you
[16:59:15] <fhain> just read the docs or google, everygthing is documented
[17:09:35] <roadrunneratwast> I have a bunch of geographical data. Are there any mongo tools or packages for searching by location? Eg. A 10 mile radius from location X?
[18:25:27] <tubbo> hey all, having a bit of an issue when i attempt to access my mongodb database. "exception: BSONObj size: 0 (0x0) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO"
[18:25:35] <tubbo> this occurs when i run `db.dropDatabase()` from within the console
[18:31:16] <Nilium> Nope. You follow me on Twitter.
[18:31:31] <tubbo> i don't remember twitter being invite-only
[18:31:47] <Nilium> Well, you probably also know me from SA, but I don't think anyone knows my SA name. I try to make sure it's unassociated with everything else.
[18:42:21] <heewa> So, if I get an InvalidBSON error from pymongo read operation, is that something I should dig into (like is it a bug in mongo/pymongo?) or just sometimes happens?
[18:42:59] <heewa> (That sounds snarky, I meant it non-sarcastically. honestly wondering if it’s just fritzy like that sometimes)
[19:31:38] <worldwide> hello :-) sorry for this question but is it possible to combine $and and $or in a mongodb query?
[20:06:40] <juanlas> hey yall, so quick question, is there any overwhelming reason to use the native mongo Date type instead of just storing an ISO date string?
[20:07:08] <GothAlice> juanlas: All of the ways in which you can query the data go pif if you store it in a non-native date format. Not to mention how inefficient storage as a string would be.
[20:07:52] <GothAlice> A la: http://docs.mongodb.org/manual/meta/aggregation-quick-reference/#date-expressions
[20:09:14] <juanlas> ah cool, thanks GothAlice, i am trying to explain to a developer why someone would want to use native types
[20:09:19] <GothAlice> '2015-02-11T20:06:11.820952' = 26 bytes, plus null, plus 4-byte leading length = 31 bytes to store this date.
[20:13:52] <mango_> ok, thanks, one moment, I'll have a read.
[20:18:15] <mango_> GothAlice: If the record (document) doesn't exist, then can defaults (values) be applied?
[20:18:30] <GothAlice> That's what $setOnInsert does.
[20:18:56] <GothAlice> From the first paragraph of the link I gave: "If an update operation with upsert: true results in an insert of a document, then $setOnInsert assigns the specified values to the fields in the document. If the update operation does not result in an insert, $setOnInsert does nothing."
[20:23:45] <mango_> GothAlice: however if upsert:false, and a record exists then we do nothing right?
[20:25:27] <GothAlice> if upsert is false, $setOnInsert will either error (no point supplying it) or gracefully do nothing, regardless. (If the record didn't exist, with upsert: false, nothing would happen anyway.)
[20:29:01] <mango_> GothAlice: ok makes sense, thanks for the explanation.
[21:06:50] <worldwide> thank you StephenLynx, after i tried it it works,.... i'll promise i will test it next time before i ask :-)