[01:44:20] <j83> After I added in the $match object, I'm now getting an Unexpected Identifier error. I cannot seem to correct it. Also is this proper usage of $project? For some reason I cannot get the $unwind and $group to work with "$alerts.name" unless I alias it through $project.... http://pastebin.com/Z6z40ay1
[02:27:01] <someprimetime_> i'm doing a reset pw functionality and curious if i should create two collections for it (one for storing the entry of the pw reset action) and then setting a boolean within the User schema to `reset: true..current algorithm: http://pastebin.com/21he4E2j
[05:39:37] <pringlescan> I'm using MongoDB 2.4.1. I'm inserting 624k documents, with safe and w:1 using the Node.JS driver. That works, the callbacks are fired as the inserts occur. Immediately after that from the same app, I insert another 250,000 documents into a different collection (same database). This time, NONE of the callbacks fire.
[05:39:53] <pringlescan> The documents are being inserted, for the first 43k [same number every time], then it stops for a minute or so, then it starts inserting at 11,000-13k a second according to MongoDB's stats, and then all the callbacks fire, including the 43k that hadn't fired before.
[11:59:41] <alcuadradoatwork> if not, how can I count the number of documents that are identical except for their _id?
[11:59:49] <sinclair-linux> Nodex: note tho, im not sure i know why i would need to tinker with php mongo client/driver, its connected successfully to other stuff
[12:00:22] <sinclair-linux> including a mongo instance on this very machine, when i run the command...
[12:00:35] <sinclair-linux> mongodb --dbpath /asda/ --port 12345 for example
[12:00:45] <sinclair-linux> the problem isn't the PHP client is what im saying
[12:05:06] <Nodex> you asked how to start your mongod - which I told you
[12:05:46] <Nodex> you started to question why I was asking you to test things which I don't have time for and am not interested in discussing. You can either accept help or not - choice is yours
[13:08:33] <Kosch> Creates "Oplog" a set of files similar of Oracles Redolog, which can be used as kind of incremental backup?
[13:11:01] <Zagdul> Kosch, I don't think so. Technically you're probably right, but I don't think there's a way to play back such a stored oplog
[13:11:39] <Zagdul> woozily - this is strange, we have a similar collection here, updating (from Java!) works about 1000/sec
[13:14:17] <Kosch> Zagdul: how is usually the backup problem solved when having large amount of data? always backup all data sounds not really practical to me.
[13:17:19] <Zagdul> Kosh: if you have an Idea, tell me ;-)
[13:17:39] <Zagdul> Kosh: we're exporting everything (right now about 250GB only - so that works for now)
[13:17:51] <Zagdul> and: we created incremental backups of the filesystem
[13:24:50] <Kosch> Zagdul: Unfortunality the situation is that the data is located on hardware sitting in customers office. so I've only usb or network as transfer medium... indeed, maybe FS snapshots using LVM could be an option.
[13:52:42] <Kosch> Zagdul: or other idea: lets say I'd configure an 2nd mongod as secondary. when backup is started, the secondary node is started and data will be replicated. the secondary stores their data on the backup device. when finished, secondery mongod will be stopped. Is in these cases also everything replicated, or just the stuff between the last time secondary is started?
[14:46:27] <sinclair-work> saml: oh, i was looking at the Linq stuff for the Mongo driver, and although i can query fine, it would be nice to use the Linq to filter a subset of documents to delete
[14:55:06] <sinclair-work> i should be able to pass that to the remove method
[14:55:18] <sinclair-work> thanks for your help guys
[14:55:35] <saml> you're welcome. now buy a mongodb tshirt
[14:55:58] <sinclair-work> saml: that license do i need to agree to to wear it?
[14:56:03] <Snebjorn> Zagdul: The embedded documents are small in size but there are a lot of them. Lets say a document look like this { _id: ObjectId, owner: userRefId, ... } then I'd like to query on all owners. When I put them in a separate collection even if I index on owner I can only get about 30 queries/sec (benchRun) which I find odd. However if I embed them and do a find({"subs.owner:xyz"}) then I get about 30k quries/sec however I get a lot of
[14:57:30] <ninkotech> sinclair-work: would you prefer GPLv3 ? :)
[14:58:11] <ninkotech> sinclair-work: do you actually read licenses of all software you install?
[14:59:54] <saml> if app connects to mongo01.mongodb.com , it doesn't have to know if the end point is replica set or not
[14:59:55] <sinclair-work> well, if you are going to use some software in a commercial product, better be familiar with the license, otherwise....you'll get burned one day
[15:00:22] <ninkotech> yes... what dont you like on agpl?
[15:00:57] <scoates> I stumped Derick with this one yesterday. Maybe someone else might know why my query (second stanza) isn't using the "right" index (see the next stanza for the hint), here? http://paste.roguecoders.com/p/4face5649612e840da04c5fea0491c9b.txt
[15:01:33] <Zagdul> Snebjorn, this is weird. R U sure the index was hit? usually the separate collection should be faster
[15:02:00] <sinclair-work> ninkotech: just things, i don't really have much time to go into detail as i have a meeting to be in in 5 mins
[15:02:09] <ninkotech> sinclair-work: btw, thats why i dont use most mainstream webs
[15:02:10] <sinclair-work> ninkotech: let's discuss later
[15:02:46] <Snebjorn> Zagdul: I used ensureIndex({owner:1})
[15:03:00] <meekohi> I'm such a n00b. How do I count the result after aggregate($group: {…})?
[15:03:36] <meekohi> .aggregate({ $group: {_id: "$identifier"}}).count() doesn't work how I'd expect.
[15:03:51] <Zagdul> Snebjorn, and your query looks like? when you only have owner in the query, all should be fine. if your query is more complicated, the index needs to be as well
[15:04:59] <Snebjorn> query looks like this: find({owner:xyz})
[15:42:36] <Snebjorn> Any mongo gurus that wanna have a look at this http://stackoverflow.com/questions/16150942/to-embed-or-not-embed
[16:00:10] <Snebjorn> How do I cover an entire query with index if I only query on one element? Example: find({a:1}).explain() says indexOnly is false even though ensureIndex({a:1}) is called on the collection
[16:01:19] <kali> Snebjorn: you can only return field that are in the index
[16:01:41] <kali> but it will not be very interesting
[16:04:21] <saml> "errmsg" : "db exception in producer: 1000 replSet source for syncing doesn't seem to be await capable -- is it an older version of mongodb?"
[16:42:10] <dgarstang1> For some reason, this isn't working... find({'fun': 'pkg.list_pkgs'}, {'jid': 1}).sort([('jid', -1)]).limit(1) .... if i remove the limit(), the sort is fine. However, if I put the limit(1) back, the document I get is not the most recent...
[16:46:35] <Nodex> just an fyi, if you're using ObjectId's as your _id you get a free sort by using _id:-1
[16:47:08] <dgarstang1> Nodex: Without the limit(), I get a list of documents in descening order. I see the most recent first. However, after adding limit(1), I don't see that most recent document as I would expect, but apparently an arbitrary one.
[16:53:10] <dgarstang1> Nodex: ~ 2,500... but normally it will be a lot less. Hang on... I need to go back and have a chat with some people. I don't like how the document is structured anyway.
[17:30:59] <jol> Just upgraded a replicaset to 2.4.2 running with "noauth=true" and pymongo now spits "OperationFailure: database error: not authorized".. Tried upgrading to pymongo 2.5 without luck. Any idea of what could be wrong?
[17:43:35] <Kzim> hi, i have this issue on mongodb 2.0.6 : right object doesn't have full shard key and shard version not ok in Client::Context: client in sharded mode, but doesn't have version set for this collection
[17:46:51] <kurtis> Hey, we have a fairly large project which dumps all of our analytics into MongoDB. I'm working on a web-service which includes Users (and possibly billing Info in the future). I'm worried about write guarantees. Would it be recommended to take a hybrid approach and use a traditional RDBMs for the user management aspect?
[17:47:23] <hallas> Hmm, anyway I can improve the performance of an _id: { $in: […] } query, it's running incredibly slow..
[17:49:07] <dgarstang1> does mongo have a replace into equivalent?
[17:49:41] <dgarstang1> I'd like to do an update(query), and do an insert if the document isn't there
[17:53:29] <zagdul> I already asked that a couple of hours ago, maybe there are some new people around that might have experienced the same problem: when setting the W to the actual number of nodes, it ends up in a timeout in our productive environment, no matter what timeout is defined
[17:53:51] <zagdul> this error also occurred once when W=MAJORITY
[17:55:22] <zagdul> one other bug we have is the initial sync of a member in a replica set of 4 nodes: it causes the other nodes to "delay" answers or something, that caused a downtime of our application and cost us a couple of users
[17:55:53] <zagdul> I don't want to change the DB, but people in our company are discussing the migration back to MySQL again!
[17:55:57] <saml> how do I connect to replaca set using mongo shell?
[17:57:22] <kurtis> saml, I'm not a mongo expert by any means but maybe this helps? http://docs.mongodb.org/manual/reference/commands/#touch
[17:59:49] <scoates> the shell is meant to connect to a specific node, not to be a general-purpose driver
[18:00:34] <dgarstang1> I can use _id as key right?
[18:01:49] <dgarstang1> because..... this.... db.doc.update({'_id': 'hot.foo.com'}, {'fun': 'test.ping', 'jid': '20130422175559545439', 'result': 'True'}, {'upsert': 1}) keeps inserting a new document with a new _id, rather than inserting one where _id = 'host.foo.com'
[18:03:04] <scoates> dgarstang1: specify the _id in the second object, or use $set
[19:08:10] <jol> hallas, check out 3rd section of http://snmaynard.com/2012/10/17/things-i-wish-i-knew-about-mongodb-a-year-ago/, maybe related to your issue?
[19:23:33] <saml> any of databse under lb can go down
[19:23:44] <saml> lb just has to be up. if not, you get alerted
[19:24:12] <scoates> you might be able to coax mongos to do what you want, but I don't know. Sounds like you're trying to make MongoDB do something that it's not designed to do, to me.
[19:24:13] <saml> m1 isn't really database. it can be. but it's transparent. it can be proxy, lb, or whatever
[19:43:45] <hallas> hmm probably a driver issue maybe
[20:18:14] <scoates> hallas: a large $in isn't going to perform well. you probably need to denormalize.
[20:18:53] <hallas> scoates yeah actually it was because I was using Mongoose.js, which adds alot of ORM magic, which takes up a lot time and probably memory too
[20:19:04] <hallas> I just disabled that, and it came out in 20 ms
[21:08:51] <JoeyJoeJo> I have a collection of parent documents and a separate collection of child documents. I need to know which children belong to which parents, and each child will only belong to one parent. My plan is to include the ObjectID from the parent as a field in each child. Is that a good idea?
[21:09:46] <JoeyJoeJo> I know that this is trying to replicate SQL joins, but I need mongo for its lack of schema
[21:10:15] <scoates> that will work, JoeyJoeJo. Depending on your actual needs, it might be best to just store everything in one collection.