[00:07:25] <cheeser> now, time for bed time book with the kids. good luck out there. ;)
[01:24:46] <SpNg> I'm migrating a database from one AWS instance to another, and my replica sets seem to be messed up. I try to update the host on the replica set but when I run rs.reconfig(cfg) I get the error: can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE). Any ideas?
[01:42:31] <raptor_> I am looking for some help with replica sets
[01:42:39] <raptor_> I have not been able to get past this error
[01:42:47] <raptor_> error server is not running with --replSet
[01:43:24] <raptor_> I have fed my replica sets into my config server using rs.initiate(
[01:43:30] <raptor_> and that is the error I keep on getting
[01:44:51] <cheeser> you need to start mongod with that option and give a replSet name
[01:45:17] <raptor_> my config file has that option
[01:45:22] <raptor_> I am confused why its not being picked up
[01:45:48] <cheeser> i'm not sure it gets read from mongod.conf
[01:45:49] <raptor_> that is how I am starting the mongod instance on my replica set
[01:46:12] <raptor_> You must specify the run time configuration on each system in a configuration file stored in /etc/mongodb.conf or a related location. Do not specify the set’s configuration in the mongo shell.
[02:41:40] <tim85> I was hoping someone could give me some advice, I have a table with ~10million rows of data in it, and ideally I would like to write it to disk in a csv/json format every 5 minutes... I have tried to do this in node.js using the native driver (db.collection('test').find().stream()) and it is taking wayy longer than 5 mins
[02:42:11] <tim85> I am guessing that it might be IO bound - but hoping there might be something I can do to improve the speed?
[02:43:15] <tim85> oh and I am simply doing console.log(JSON.stringify(item) in the script then piping to a file (node printdb.js > output)
[02:44:05] <joannac> why don't you mongoexport instead?
[02:44:36] <tim85> I will look into that now - just started using mongodb yesterday, so wasnt aware! Thanks
[02:48:08] <tim85> hmm from the docs 'To run with --dbpath, mongoexport needs to lock access to the data directory: as a result, no mongod can access the same path while the process runs.' Is there another approach to use if i dont want to kill mongod?
[02:51:00] <tim85> ok seems a bit better, thought I had to :)
[02:56:50] <tim85> ok that works - still is slow though - is that expected for large data sets?
[03:40:32] <apipkin1> I'm trying to use mongoose to connect to a remote shared mongodb. I'm having an issue getting models to map to my collections. is this possible or is there a better option?
[03:54:47] <skybound> good morning; got a question concerning "manual" query expr evaluation: i have cursor with the result of a query; for each result i want to apply multiple query expressions and check for matches. To get to the question: is query eval implemented in the driver level (e.g. Java); or more precisely: is it likely that i can reuse existing driver code?
[04:10:54] <jkitchen> I have a delayed replica in my replica set. works great. I'd like to get it to stop playing back oplogs for a bit though, is it possible to pause it while leaving it available for reads?
[04:11:31] <jkitchen> replSetMaintenance sorta seems like what I want, but you can't read from the slave during that time
[04:13:27] <apipkin1> I only need to read a mongo db, not write to it. What is the best method for this? I've been trying mongoose, but it doesn't seem to only reads
[07:53:11] <joannac> data types? string vs objectid?
[07:54:33] <apipkin1> I've tried String and ObjectId. I didn't create a new ObjectId, just did ObjectId(id)
[08:08:34] <BlakeRG> i have an app that issues a remove and then an insert into a collection, is it possible for the insert to happen before the remove finishes even though in code the remove comes first?
[09:49:38] <RandomIRCGuy> Good day, can someone give me some info about "functions" for mongodb? In Mysql we could set up a function which gets started after some insert was done. I want to calculate some statistics and need some kind of function. Of couse I could to this in PHP with an new insert, but there should be a more performant way to do this, shouldnt it?
[09:53:35] <kali> RandomIRCGuy: what you describe is called a trigger in the SQL world, and there is not equivalent in mongodb
[09:54:06] <RandomIRCGuy> Not even close to? So I have to make two inserts every time then?
[09:54:36] <kali> RandomIRCGuy: the closest thing to it is a python hack that lurk on the operation log and triggers stuff from outside
[09:55:29] <RandomIRCGuy> Well I'm saving data from php into a file, and a python script inserts all new files into the database, so I know when a query get's inserted. Ive thought mongo provides a better solution for doing such stats
[09:55:56] <RandomIRCGuy> I guess I will do it that way then, thank you :)
[09:58:08] <kali> RandomIRCGuy: well, as a general note, mongodb tends to be simpler than SQL dbs, because it make things easier when you need to replicate and/or shard. scaling the application layers is usually easier than the database, so everything that can be achieved in the application world is meant to stay there
[09:59:20] <RandomIRCGuy> That makes sense now after I read about the potential queries I can do. It's really a hard task to switch from mysql to mongo.. it's like starting to learn driving after using a bicycle the whole life :p
[10:18:39] <Nodex> I found the learning curve for Mongodb very fast personaly
[10:28:57] <RandomIRCGuy> Nodex: Yes it is, but the start is pretty hard if you have never touched a nosql database and always relied on mysql :p
[10:29:08] <RandomIRCGuy> I must say in these few days Ive learned a lot, which is good
[10:35:56] <Derick> RandomIRCGuy: what did you find the biggest difference(s)?
[10:36:57] <RandomIRCGuy> Derick: Hmm.. I think the queries. First they look pretty easy. But when it comes to aggregations and grouping it was kind of hard to understand it in a short time
[10:37:14] <RandomIRCGuy> You still think too much in SQL. and try to do stuff mongodb doesnt understand#
[10:38:31] <Derick> Anything related to the data model too?
[10:39:43] <KamZou> Hi, is mongodump recommanded to backup a config_svr ?
[10:40:35] <RandomIRCGuy> Well, it was a bit weird to change the whole logic between sql and nosql. In my applications Ive used the 3rd data model. Always created link tables, always tried to structure the code as much as I can .. and Ive tried to do the same with the mongo db structure, but then I got hard problems when it came into grouping and trying to link all that stuff I need :p
[10:40:49] <RandomIRCGuy> It was hard to understand that I just need one big collection for my project
[10:41:38] <RandomIRCGuy> I always kept the mysql thinking in my mind and made the task for myself a lot harder
[10:41:52] <Derick> (in case you're wondering, I am currently writing a presentation on this)
[10:43:29] <langemann> Hello all, could anyone please take a look at this? http://stackoverflow.com/questions/21244664/multiple-distinct-keys-from-several-documents-in-mongodb/21244734?noredirect=1#21244734
[10:46:14] <KamZou> When i restore a config_server with a dump (mongodump) from another, during the restore i get : INVALID OBJECT - going try and pring out
[11:26:12] <harshada> Hey Someone please help me in groupby query.. Collection is "Ads" having field "offer".. Now I want to group by ads by offer .. and structure like {'$offer1':[ads1, ads2,..],'$offer2':[ads3,ads4,..] }
[12:46:41] <Gleb`> guys, I'm storing the current chat conversation between two people in mongo, whenever one tries to open a new chat window I want to find and continue the old conversation
[12:47:15] <Gleb`> So I've got this now: Chat.findOne({users: {$all: users} }).exec(function(err, chat) { //some code.. });
[12:48:03] <Gleb`> But it also finds group chats where these two users are participating, how can I make this query make the users array exactly (different order maybe but only these users)
[12:55:03] <Nodex> Gleb` : what does your users field look like?
[13:06:54] <Gleb`> Nodex: users is just an array of user ids, in the model its is defined as users: [{type: mongoose.Schema.Types.ObjectId, ref: 'User'}]
[13:32:27] <Nodex> means nothing to me but if it's an array like this [1,2] then you can match exactly that
[13:34:34] <Gleb`> Nodex: I see, well I used to find users through another mongo query so it is an array of user objects as define by the user model, i'll try that exact match approach but the order in which users are defined would matter
[13:35:58] <Nodex> pretty sure the order doesn't matter for the purposes of the index
[13:36:23] <Nodex> I've done the exact same thing you're doing (minus the mongoose crap) and it's always worked fine
[13:40:31] <Nodex> at worst you can just apply a sort to the array when you save it and a sort to it when you query it
[13:40:47] <Nodex> (a sort in your language not in Mongodb)
[13:41:47] <jonaswouters> How long does renaming a large collection take? Is that instant ?
[13:41:57] <Gleb`> yeah, seems to work so far, need to fix something else to test properly, thanks :)
[13:51:08] <RandomIRCGuy> I have a model like this: {_id, Host, Title, URL} how can I aggregate all the documents when I want to find every document that has a specific Host and filter the documents by Title? So .. if I have two documents who have the same Host and Title, I want to get one. Is that possible?
[14:01:00] <riot> are there any plans for something like this: http://en.wikipedia.org/wiki/Spatiotemporal_database
[14:04:38] <KamZou> After recovering from a crash on 2 of my 3 config servers i got the following message in the mongoS logs : "errmsg: "official version less than mine?" any idea how to solve it ?
[14:07:10] <Nodex> riot : Mongodb has geojson and polygon support already
[14:09:32] <riot> Nodex: i know. I'm awaiting some new incoming hotness (iirc 2.6?) to see how s57 can be integrated.. but the temporal aspect would relieve me of coding substantial parts of that, or at least give me a good place and mechanisms to store and work with time data
[15:50:48] <Nodex> Derick : is there a php helper method for a geoNear query returning distances?
[15:51:01] <Nodex> or does it have to be done with runCommand
[15:52:06] <Derick> right now, only through aggregation
[15:55:16] <Derick> yeah, no - we don't really add helpers for simple things
[15:57:09] <Nodex> so'k, I'll just write one quickly in my wrapper, no biggie
[16:02:48] <ekristen> hey guys, is there any way to make sure mongos or a client doesn’t read from a replica if the replication lag is greater then a defined value?
[16:05:49] <Joeskyyy> You should be able to use the oplog as your helper for something like that, just a quick sanity check before you do the read
[16:31:07] <apipkin1> In express with mongoosejs, I have a query that works and returns an item. When I copy the _id value as a string, and pass that back into the query with `findById(itemId)` it returns an empty set. Am I doing something wrong?