[04:18:47] <aonomus> Anyone up at this time of night? Possibly able to answer a question?
[04:27:56] <Boomtime> hi aonomus! nighttime is a geographical feature, people in this channel are all over the world -- ask your question, someone may be able to help :-)
[04:28:30] <Boomtime> (btw, it's just after midday here)
[04:28:56] <aonomus> So I'm using node-red to write data to mongodb, the format going in is "date":"2016-08-17T02:15:13.000Z" however Mongo seems to want to use moment.js to interpret that date, and turn it into a nested json object
[04:29:40] <Boomtime> eh? mongodb does no interpretation, what is the type of the data going in?
[04:29:51] <Boomtime> what you quoted was a string
[04:30:10] <Boomtime> but if you're getting something else out, then it didn't go in as a string -- i suspect you have a Date object
[04:30:27] <aonomus> Hm, so maybe it's node-red-node-mongodb converting the date
[04:30:40] <aonomus> Apologies for the semi-spam incoming...?
[04:30:47] <aonomus> But it shows up when retrieved like so
[04:31:07] <Boomtime> try testing out your stuff in the mongo shell -- the shell is a javascript interpreter so it should be familiar quick enough
[04:31:28] <aonomus> This is where I invoke the 'dammit jim I'm a chemist, not a programmer'
[04:31:44] <aonomus> card and hope for sympathy. I've trawled google and docs for hours to no end
[04:32:05] <Boomtime> if you're not a programmer, but trying to do programmer stuff, you're going to have a frustrating time
[04:33:03] <aonomus> I do enough of it for mad science, I'm just entirely unfamiliar with js, node.js, mongodb; that's all an aside.
[04:33:08] <Boomtime> btw, the big splat of stuff you pasted is JSON
[04:33:43] <Boomtime> that JSON is not even remotely related to MongoDB, nor to the MongoDB Node driver, it is thoroughly user-land data
[04:34:03] <Boomtime> it kind of looks like some custom date object from some abstraction layer
[04:34:14] <aonomus> Fair enough - that sanity checks that it's what is being fed into mongo, not what's coming out of it
[04:34:27] <aonomus> At least now I know to look in a different direction, thanks!
[04:35:28] <Boomtime> if you give the node driver an object that mongodb doesn't know, it'll just encode the raw document structrure as is, as json -- that object of yours genuinely looks like that under the bonnet
[04:36:15] <Boomtime> if you expected something else then it's because the object you have is generated by (and abstracted by) your framework
[04:37:57] <aonomus> I wasn't expecting the mongodb node to be converting the date format, I used to stuff the data into a text file which had the original date format. Oddly enough if I search that particular github repo for anything related I come up empty so far...
[04:38:05] <aonomus> (will keep digging, not looking for a handout answer per-se)
[06:30:52] <shackra> getting a configuration value from the mongo database is bad idea? because I have a code that do good amount of reads into the database and I'm worried in production this will slowdown my bot
[06:33:37] <Boomtime> can you frame the question in terms of the how you intend to use mongodb?
[06:33:54] <shackra> Ok... I want to store the language preference of my users in the database
[06:34:23] <shackra> and retrieve it every time my app needs to send a translated message to the user
[06:35:25] <Boomtime> i think those are the other way around -- when you are about to send a message, you retrieve the setting to know if you need to translate it, yes?
[06:40:08] <shackra> the second read is actually many reads to the database since gathering the language preference for translating each string that's going to be send to the user as reply
[06:40:46] <Boomtime> the user has multiple language preferences?
[06:41:13] <shackra> but he can switch the language later in the configuration options
[06:41:45] <shackra> my app is a Telegram Messenger bot, so, it serves to a lot of users
[06:42:40] <Boomtime> well, this is your call -- a query is fast, especially if it's well targeted, but there should be a good reason to do it
[06:43:10] <Boomtime> your application design currently forces you to do a superfluous extra query for the language preference, despite already having checked the same data recently
[08:47:45] <ams__> Any pointers on what I might be doing wrong here greatly appreciated! https://groups.google.com/forum/#!topic/mongodb-user/NvYblQqTmE0
[08:49:51] <Derick> The initial sync started well but after 22gb (of 200gb) was synced it failed. Now when I resync (by doing cfg = rs.conf(), rs.reconfig(cfg) I get the following error in my secondary logs:
[10:03:49] <ams__> @Derick It does say "initial sync done"
[10:04:07] <ams__> But .. where's the remaining 180gb of data!
[10:06:10] <Derick> ams__: maybe you have lots of gaps in the original data?
[10:06:30] <Derick> have a look at the collection counts - to see whether each collection has the same amount of documents?
[10:07:05] <Derick> it is not impossible that a new sync uses lots less data - especially if you were on an older MongoDB, and/or, you're now using WiredTiger with compression enabled.
[10:08:07] <Derick> ams__: can you show the few lines where the synching started too?
[10:09:06] <ams__> @Derick here you go https://www.irccloud.com/pastebin/uH5S2irp/
[10:09:55] <Derick> if that's all that's in the log, it seems... working
[10:10:23] <Derick> but do try to see if each collection has all the documents though
[10:10:30] <Derick> I can't see why it wouldn't though.
[10:27:05] <ams__> @Derick I have a lot of databases + collections, but picking a few it looks OK
[10:27:17] <ams__> But that's such a huge difference
[10:27:49] <Derick> sounds like a great feature :P
[10:28:25] <Derick> I think there might be a script to show the collection count for each collection in each db
[15:39:50] <mortal1> howdy folks, i have two collections, one that tracks job status (queued, processing, failed, etc) and one that has more info on the job itself. I need to query the 'job details' collection based off the jobId on the jobStatus collection. I'm on mongodb 2.6
[15:40:29] <mortal1> (we had issues with concurrency when trying to update the status on the original job collection, which is why we have two collections)
[17:08:38] <mortal1> could anyone give me advice on doing a subquery using a property from another collection?
[17:18:03] <cheeser> i'm Visa: everywhere you want to be.
[17:18:15] <cheeser> hrm. well, i'd expect what you have to work...
[17:18:40] <mortal1> yeah i think I'm gona map it into a var and use that var for another query
[17:18:44] <cheeser> instead of doing a query in that forEach(), try just printing out d and make sure you're getting what you think you are.
[19:30:14] <angular_mike> is there built in support for returning a random document from those that fit the query, while trying to ensure that they don't repeat for as long as possible?
[19:55:34] <angular_mike> cheeser: will it keep outputting different documents each time I call it until there are no more documents left that haven't been output yet?
[22:37:20] <angular_mike> I want to filter document in collection by value range of some fields and then return a random one of the resulting documents. Should I use $sample?