[03:15:09] <aws_2012> I apologize if this has been asked before/recently, but has anyone had difficulty getting and keeping your secondary node sync'ed?
[03:22:19] <aws_2012> repeat question: I'm having trouble getting and keeping my secondary in sync with my primary, despite turning off writes to the primary. Can anyone advise what I might be doing wrong?
[03:50:37] <ashepard> trying again, hoping i might find a nugget of wisdom: having trouble getting and keeping a secondary's optime up-to-date, despite turning off writes. anyone have any ideas to try?
[07:49:33] <dstorrs> when using the '$or' operating for querying, is clause evaluation order guaranteed to be left-to-right?
[07:53:26] <NodeX> it's not really relevant because either of the clauses satisfy
[07:56:00] <DigitalKiwi> how can I tell what indexes I should add to make a query work better? just by experience or trying different ones or is there some tool that could help?
[07:57:42] <NodeX> watch your logs, it will log slow queries
[07:57:54] <NodeX> and explain() else helps by telling you what it's doing
[07:58:22] <NodeX> general rule of thumb is this : if you have large data and are querying on a key then it should be indexed
[08:00:17] <DigitalKiwi> I get it for single indexes but if I needed a multi index I think I would be very lost :(
[08:04:11] <DigitalKiwi> also, I know having indexes slows down inserts, but how *much* does it slow it down? Like could it be enough that it's faster to drop the indexes and recreate? all the datasets i've had only take a few seconds to add an index, but getting the dataset updated takes a lot longer but i don't know if it's just how it is or the indexes...
[08:16:26] <dstorrs> DigitalKiwi: what are you trying to achieve?
[08:16:50] <dstorrs> and how are you doing the update? via update() or findAndModify()? (the latter is ~100x slower than the former)
[12:13:29] <Derick> that information is part of the cursor
[12:13:38] <Derick> (it's basically a list of pointers to documents)
[12:13:42] <Bartzy> a query happenes and the first next() is issued for: db.sample.find()
[12:14:00] <Bartzy> Ah, so that cursor is saved in memory, and is a list of pointers ?
[12:14:38] <Bartzy> But the pointers are to the actual location on disk (or RAM, if the OS decides it should be there) of the documents, and not some pointer to the _id or something, right ?
[12:15:30] <Derick> for the mongo server RAM=disk, there is no distinction. And yes, they're pointers to the location of documents
[12:17:20] <Derick> Bartzy: http://www.mongodb.org/display/DOCS/How+to+do+Snapshotted+Queries+in+the+Mongo+Database has a good explanation
[12:17:54] <Bartzy> I have one more question about .explain(). When executing explain on heavy queries, it doesn't really end, and you need to wait a lot of time
[12:18:12] <Bartzy> This defeats the purpose of seeing what the db is doing in order to optimize it..
[12:18:28] <Derick> it's just reading all the reasons so it can provide statistics
[12:18:42] <Derick> I got to go now, train to catch.
[12:23:51] <Bartzy> But then what's the purpose of it for long-running queries? Is it possible just to get the decisions it's going to make like index use and stuff like that - like MySQL's EXPLAIN ?
[12:32:38] <multiHYP> how can I get the password in form of readable String in my app?
[12:33:20] <multiHYP> the password field in system.users collection.
[12:33:42] <multiHYP> I believe its some kind of hash of the password saved in the db.
[12:34:42] <multiHYP> please someone answer that, I asked the other day and still haven't found how to do it. although I have been doing some other things ever since too.
[12:38:53] <multiHYP> is bcrypt available as a .jar lib for scala?
[12:39:03] <multiHYP> see the issue is not that straight forward.
[12:39:17] <multiHYP> I want to reuse the db user/pass for my app layer login info.
[12:41:41] <multiHYP> yes that pair in system.users seems to be not usable.
[13:20:54] <unclezoot> hi - i see it's possible to see what points are within a polygon, but can mongo tell you which poly contains a specific lat/lon?
[13:21:15] <unclezoot> i.e. you know the point but now want to know the containing polygon
[13:21:56] <NodeX> the polygon can be exponentialy large so not reallyt
[13:23:23] <unclezoot> well all im trying to do is work out what district a clicked point is within
[13:24:09] <unclezoot> i can find the nearest 3 districts using the geo index and a centre point within each of the districts to approximate the centers
[13:24:16] <unclezoot> that will whittle down the resultset
[13:24:40] <unclezoot> but then how to determine which district the point is lying in?
[13:37:43] <fredix> I have two persistante connection to mongodb, but when I insert data from the one, sometimes I can't get the data from the other connection
[13:44:17] <NodeX> unless you store the char count in a separate field
[13:44:36] <NodeX> you can use $exists to make sure the field exists
[13:44:58] <NodeX> or possibly (though not efficient) a regex
[13:49:24] <mw44118> NodeX: checking if the field exists doesn't seem to do what I mean; the field can exist, but point to a NULL value (or whatever you guys use for NULL).
[14:29:22] <Bartzy> algernon: Why not just use regular ol' files ? If you're not adding indexes on the capped collection, it's pretty much the same
[14:29:52] <Bartzy> algernon: And that's only for application logs? errors and stuff? I didn't understand why many examples are for using capped collections for user interactions. Something needs to process those user interactions.
[14:30:34] <algernon> Bartzy: because I want structure. I can do that with files, but with mongodb, it's a lot easier.
[14:30:58] <algernon> Bartzy: nothing prevents you to send logs to a capped collection AND a non-capped one.
[14:31:19] <Bartzy> algernon: And then what's the capped one is giving me exactly ?
[14:31:35] <Bartzy> I just don't understand what's its purpose other than a fixed-size bucket for logs
[14:31:40] <algernon> Bartzy: very fast access to the last couple of thousand logs.
[14:31:43] <Bartzy> which is ... nice, but not so useful
[14:32:31] <algernon> plus, you can put a erm... what's it called.. well, a cursor on the capped collection that will follow the data coming in.
[14:32:59] <Bartzy> That's useful... But I guess some message queue is better at that
[14:33:02] <algernon> so you push logs into a capped collection, and you have your processing application listen via the cursor, do whatever processing you need, and send the result off wherever you want.
[14:33:28] <Bartzy> What happens if the processing application dies? The cursor dies with it, and some logs are lost (to processing, at least) ?
[14:33:35] <algernon> a message queue might be better, yes. but it also might be an overkill.
[14:33:50] <algernon> Bartzy: yup. That may or may not be a problem for your use case
[14:43:38] <algernon> because I save *every* log in mongodb
[14:44:26] <Bartzy> is it on different collections, or just one 'logs' collection ?
[14:45:00] <algernon> one big logs collection, a few stats collections and a capped recent collection
[14:45:26] <algernon> I'm not entirely happy with the way I deal with stats, but had no time to come up with anything better yet.
[15:00:05] <timing> Hi! I have a collection with a few basic fields and one field contains a large multi dimension array. I don't mean to query on the data in the array. So can I just put the array in the collection as well. Or is it (performance wise) better to just serialize the array myself as string before insertion? So it just becomes a large string instead of a 'real' array
[15:01:41] <timing> So the data can be something like this: {field: 'value', bigArray: '[[1,2,3,4],[603,123,2039]]'}
[15:54:25] <mediocretes> but, a double is the same size as an int
[16:28:57] <Lujeni> Hi - i need move many documents between two servers. Should i use mongodb command as mongodump / mongorestore ? or store all document in variable and use "forEach" to insert?
[16:30:39] <SLNP> We are seeing a strange issue at the moment, we are hitting a connection limit of 1000 on our mongo rep set and both mongo instances are crashing
[18:02:33] <redalpha> If i have 2 servers setup with replication - and both servers have an application connected to their own mongodb - and both applications doing writes and reads, will that go well ?
[18:10:46] <armandop> kinda a n00b question too. what is the best practice to create a collection.
[18:11:20] <armandop> lets say im creating a mobile app and the data we collect is just for a specific user, comments, and other users do not see these comments uts just the user
[18:11:59] <armandop> i want to create a single collection called users which contains a comments property which holds an array of Comment objects.
[18:15:28] <mollerstrand> armandop: a collection is created as soon as you insert a document into it.
[20:37:02] <timing> when I have a comment attached to a post i can give the comment a post_id. what can I ise best the the id? the MongoId object or just the numeric $id value?
[20:44:20] <bluejade> where is the best place to ask beginner / intermediate questions related to structuring and querying mongodb documents? here? mongodb-user google group?
[21:45:48] <armandop> {_id: 697698779886hhy76 } <-- starting object example. when you call it from code if you convert the object id to string it will no translate to the object id. object id != (string)object_id
[21:46:39] <domo> ah i see, but my driver in the app allows me to create MongoIds as objects from strings
[21:49:05] <domo> and what about sharding - do ObjectIds get screwy across multiple boxes?
[21:49:40] <armandop> that im not too sure never look that closely into it.
[22:00:07] <hadees> is there anyway to see what queries are being run? I have a mongodb query that works but when I converted it to php it doesn't. So now I want to see what is actually being run.