[00:08:07] <gundas> Hi all, I'm trying to insert a JS object with a date in it (ISO format) into mongo however mongo keeps thinking the date is a string, is there a way to force it to recognise it as a timestamp?
[00:18:41] <pbryan> I seem to be successfully using multikey index with two array keys, in contradiction with the documentation. Does this really work or am I smoking crack?
[04:53:43] <Gern> { "_id" : ObjectId("54a380be9546347a4e8b4568"), "name" : "a" }
[04:56:01] <Gern> it's reporducible, tried to flush my ubuntu VM, reinstall the whole thing. Always the same result : ID reported to PHP is not the same one as Mongo
[04:56:44] <joannac> If you specify an object id in $a, does it get saved correctly?
[04:59:19] <Gern> specified ID = 54a380be9546347a4e8b4567
[04:59:21] <Gern> { "_id" : ObjectId("54a380be9546347a4e8b4567"), "name" : "a" }
[05:18:27] <joeyjones> My next suggestion would be to get your PHP up to a newer version
[05:18:49] <Gern> Also, in PHP, after I inserted A, if I print iterator_to_array($collection->find()) I see the same ID of $a['_id']. But if I refresh the page and only print iterator_to_array($collection->find()) (without inserting first) I see the ID of mongo shell...
[05:19:04] <joeyjones> I'm running 5.5.15 and 5.5.20
[06:02:12] <Gern> I know my dev VM is far behind... haven't updated it for the past5 years :)
[06:17:05] <pbryan> On 2.6.6, I seem to be successfully using an index with keys, both which contain arrays of strings. This seems to contradict the documentation. Query plan explains I am using the index. How is this working?
[06:22:14] <joeyjones> yeah, i hate when the prod environments get spread out
[06:24:11] <Gern> Could it be just a problem with the way the ID is generated? Maybe I'm missing a config in PHP and that MongoId that get automaticaly generated is ignored by mongo ?
[06:24:33] <joeyjones> no, that shouldn't be the problem...
[06:26:16] <joeyjones> it seems to me like the is being altered after the insert, or you may be trying to insert on top of an existing id in which case the db isn't changed but _id is generated client-side so you have a new id on your end
[06:34:09] <Gern> what bugs me is that when I specify a ID, its ok
[06:43:34] <Gern> I also tried to insert 1 document with a ID of "54a399eefa4634d3388b458b" and a second one with new MongoId(). Mongo shell shows the first one is correct and the second one is wrong
[06:44:55] <Gern> Even if I try to convert new MongoID() to string first, it get altered anyway
[06:45:42] <Gern> Look's like that everything that resemble a newly MongoId gets altered
[06:46:31] <zzing> Is there a proper regex for an objectid?
[06:52:33] <joeyjones> Gern: and you're use the mongo extension in PECL, right?
[07:07:24] <joeyjones> i swear that there will be some stupidly simple bug somewhere that caused this all
[07:10:06] <Gern> didn't change anything, everything that look like an mongoid, even if it's in an other field like "test" or "dfskadfhkufsd" get altered like _id is
[07:11:13] <joeyjones> i think i may have found something
[07:11:39] <joeyjones> the last 3 bytes of the mongoid is a counter
[07:33:43] <Avihay_work> Hi, I have a local DB and a remote DB. I mongodumped my local, uploaded and mongorestored on the remote system.
[07:34:56] <Avihay_work> I can run mongo on the remote system and connect via a user and password
[07:37:06] <Avihay_work> but when I run >show collections or > db.phones.find() on the remote system, it fails with 2014-12-31T00:29:21.033-0700 error: {\n "$err" : "not authorized for query on CMwebapp.system.namespaces",\n "code" : 13} at src/mongo/shell/query.js:131
[07:37:24] <Avihay_work> while it runs perfectly fine on the local system
[07:41:59] <Avihay_work> local version 2.6.3 remote 2.6.6
[07:43:53] <ollivera> After a reboot I can't authenticate on secondary ... I stopped the secondary, removed all files from dbpath and started again ... all dbs have been copied .. due the sync ... but user information how can I restore the user information in the secondary so much so that I can authenticate again?
[07:49:00] <ollivera> I can't see the system.users collections in the secondary
[07:50:16] <Avihay_work> you should be able to roll over the users collection with mongorestore
[08:11:45] <Avihay_work> ah, I didn't have auth on on the local server, now both of them fail, JOY!
[08:17:00] <ollivera> Avihay_work: it didn't work ... after restore a backup .. no system.users, only system.indexes
[08:20:31] <Avihay_work> did you look at the command output? mine was http://pastebin.com/aLjNVd5p which suggests it restored both my "admin.system.roles" and "admin.system.users"
[09:06:34] <ollivera> Avihay_work: okay, it seems that I don't store users in admin database, it is stored somewhere else, so that's why it is not restored
[12:30:37] <crised> Hi, What's exactly is an index in mongodb?
[12:31:14] <crised> Is what mongodb internally uses to save data, or is it the "primary key" that we use?
[14:02:49] <crised> joannac: I see, it's a standard procedure...
[14:03:29] <crised> joannac: If I choose mongolab, and I do have oplog access, What would I miss from having full admin privilige?
[14:06:06] <joannac> i have no idea, it depends on what privileges you get from mongolab
[14:16:11] <crised> joannac: There are many platforms there ec2, dotcloud, google, joyent... which of those is the most straight forwarrd way to set up a replica set
[14:19:56] <joannac> the steps to start a replica set aren't really related to your hosting provider
[14:21:15] <crised> MongoDB runs well on Amazon EC2.... doesn't specify size of instance...
[14:21:45] <joannac> that's because it's dependent on what you're doing
[14:24:45] <crised> joannac: mmm, I think for my case a small app, I should be delegating db stuff to a service provider, only thing that frightens me is the restriction of privileges
[14:30:53] <joannac> well, if you want a managed service, then that will always have a price tag and come with some restrictions
[18:54:15] <crised> Since _id is comprised with a timestamp as well, can I rely on this timestamp? I mean, can I do queries that uses the timestamp information? e.g. all of the persons inserted after year 2013?
[19:39:35] <Gern> I'm back with my absurd problem guys...
[19:40:06] <crised> If I add an index to my collection
[19:40:55] <crised> When find() gets called, how to get items sorted by time of insertion?
[19:45:04] <crised> In other words, if I add no index, when I call find() it will return the documents as they were inserted
[19:45:25] <crised> so how can I add an index, and have that *natural order*
[19:46:36] <RaceCondition> when using a tailable cursor, if my app restarts, will the cursor continue to return documents where left off?
[20:25:50] <sellout> There seems to be a bug in $where selectors: { "$where": function () { return x; } } works, but { "$where": "x" } doesn’t (zero documents pass the filter) when `x` contains an anonymous function. Has anyone else seen something like this?
[23:57:52] <mordof> I've not worked with mongo much.. right now i'm trying it more as an experiment - currently I'm looking into storing x,y coordinates with each collection entry. I've seen mention of 2d indexes, or geojson coordinates, but i'm not quite sure how to go about using them (or if that's even exactly what i want). anyone know of a decent spot for me to start reading up on this topic?