[02:28:56] <FatBoyXPC> Went looking through modifiers came up short. I want to update a specific document. The field I want to update is also an object. So I kind of want to addToSet but this isn't an array, it's just another object. How can I accomplish this?
[02:31:47] <FatBoyXPC> For clarification, my document looks like: {_id:objectid(), name:"etc", someObj:{key:value,key2:val2}} something like that
[02:32:09] <FatBoyXPC> what I want to do is add another key/value to the "someObj" but I don't want to overwrite it.
[02:37:26] <drjeats> db.yourcollection.update({'_id':id}, {'$set': {'someObj.key3':val3}}) should do it
[02:41:20] <FatBoyXPC> that removed the existing keys :(
[02:41:34] <FatBoyXPC> ohw ait, I didn't do someObj.key3
[03:40:49] <FatBoyXPC> i really don't want to have 200 queries, there's gotta be a better way
[03:40:52] <FatBoyXPC> Can I do an update off a select?
[03:41:12] <FatBoyXPC> more specifically can I do something like field: field + {}?
[03:43:11] <FatBoyXPC> sort like in js I can do obj.concat({key:val})
[04:18:10] <Drewch> Can someone tell me if there's something wrong with my TTL index? https://gist.github.com/Drewch/7623265
[04:18:35] <Drewch> I have one entry (it's in the gist), and I'm expecting it to be expired from the table, but it's still there
[04:26:33] <Drewch> People in stack overflow talking about seeing TTLMontior running in the logs, but I don't see that at all
[04:41:48] <Drewch> Can I use TTL indexes when running mongos locally?
[09:52:44] <sikor_sxe> hello, i have a problem with the node driver (MongoClient) for some reason it fails to perform simple find() operations. "collection.find().toArray(function(err, result) {});" will result in a TypeError, claiming there is no method "toArray()". (although this code used to work) Anyone got a hint what might be wrong? http://pastebin.com/rQFqVzW2
[10:22:46] <kali> sikor_sxe: you need to get the toArray inside the callback
[16:23:58] <Derick> not currently - I think there is a jira ticket for it
[16:24:18] <Nodex> ah cool, i've been going mad all day trying to get round it haha
[16:24:23] <Derick> but it's marked as "won't fix" - ie, don't use keys that consist of numbers, as PHP can't make the distinction
[16:24:45] <Nodex> I need the numeric keys - I am not querying on it, it's simply storing a schema and the numbers represent things
[16:25:27] <Nodex> current;y I just use JSON_FORCE_OBJECT on json_encode() but it's a little hacky and I would like to simply output the whole object without having to loop each key/value
[16:25:51] <Nodex> if it's never going to be fixed I'll have to store them elsewhere as Json strings I guess
[16:27:24] <Nodex> the strange thing is this... if you store {"0":1,"1":2} it comes out as [1,2] but if you store "1":1,"2":2, it comes out as an object {"1":1,"2":2}
[16:27:51] <Nodex> it only effects arrays that START at zero and are concurrent - any skips or breaks and it stores the key/value as an object
[16:28:29] <Derick> it's how the driver detects associative arrays (objects) vs numerical arrays in JSON
[16:28:54] <Nodex> but I wouldve' thought that if php can't distinct between numbers and strings as keys (when they're stringified numbers) then whether they start at zero or not wuld be irrelevant
[16:29:51] <Nodex> it wouldn#t be a problem but I ingerited a structure that starts with Zero's in 3 out of 20 keys haah
[22:30:07] <floatingpoint> I end up with TypeError: object is not a function when I try to load the data
[22:31:15] <floatingpoint> additionally, how can I determien what DB i am connecting to?
[22:34:29] <Lobosque> how do I change the values of a collection returned by a find? My try is var test = Fretes.find({}).map(function(i) { i.from = 'test'; }); but test comes as undefined.
[22:34:56] <joannac> floatingpoint: that doesn't look like mongodb syntax
[23:09:33] <synesp1> I have an issue I need some advice on - I have a collection where I write a document for every click in a web app. Suddenly, the clicks weren't being written and there were no errors from the insert.
[23:09:50] <synesp1> I performed a remove on the collection and suddenly it was writing again..