[09:38:27] <tiller> I've some mongos/c/d servers running on 4 machines, and I try to set proper iptables
[09:38:40] <tiller> But when I set, on 10.0.0.250 for example, those ip tables: http://pastebin.com/7rAZD9xR
[09:39:00] <tiller> If I remove the "ACCEPT ANY", my replication stop working
[09:39:19] <tiller> do you have any idea of what I'm missing? (and yes, port number are correct)
[12:43:20] <djlee> Does a compound unique index apply in both directions. So if i have a unique index on "FieldA" and "FieldB", and i enter 1 into FieldA and 2 into FieldB, can i make it so the unique constraint will also stop 2 being inserted to FieldA and 1 being inserted in FieldB
[13:19:52] <Nodex> djlee : unique constraints are on the index as a whole
[13:25:56] <djlee> Nodex: right ok, i presume it was a one way uniqueness so "1,2" != "2,1". Clearly not then, which saves me writing a load of management code :D. Thanks for your reply
[13:44:53] <singh_abhinav> is it good practice to always set write concern to Journaled
[13:45:57] <KamZou> Hi, is this possible to use 2 or more shards in parallel for writing ?
[13:53:52] <Nodex> singh_abhinav : that;s down to the compliance your app needs
[13:54:35] <Derick> KamZou: can you elaborate what you're trying to do?
[13:54:46] <Derick> Nodex: a little bird is telling me that j=1 is going away...
[13:57:21] <KamZou> Derick, i'm not using balancer (cause i've got some contraints) and i'd like to know if there's a way to configure mongodb to write not only on one shard but on many ? (at least 2)
[13:58:53] <cheeser> it'll write to the shard for that shard key
[13:59:10] <cheeser> each shard can have it's own replSet, though, iirc
[14:04:53] <Derick> KamZou: when why not use the mongos balancer?
[14:05:30] <Derick> mongos will make sure half your data gets written to each shard (with a properly chosen shardkey)
[14:05:52] <KamZou> Derick, because my dedicated servers haven't the same volumetry at all
[14:06:20] <KamZou> Derick, some of my shards are currently full of space but i want to keep this retention
[14:06:21] <Derick> KamZou: then you need to do the sharding by hand, and your app needs to know to which of the shards to write
[14:08:09] <KamZou> Derick, my apps doesnt "have to know" which shard to write... The backend is the mongoS who dispatch to the correct shard (i set manually)
[14:08:39] <Derick> the writes will be in parallel.... why do you think they are not?
[14:08:41] <KamZou> Derick, but i'd like to know if i could have 2 shards at the same time in the way i do with one today
[14:14:23] <cheeser> ron: i did it all for the cookie.
[14:14:41] <singh_abhinav> Nodex: that will make app little bit slow right
[14:15:15] <KamZou> i disabled balancer on my mongoS. Right know i've many shards. Each time a shard is "full" i manually edit the shard where "all" data goes. So data go to one shard, i'd like them to go to 2 or more
[14:15:38] <cheeser> why would you do that? do you hate your weekends that much?
[14:23:11] <KamZou> I'm just discovering this parameter : http://docs.mongodb.org/manual/tutorial/configure-sharded-cluster-balancer/#change-the-maximum-storage-size-for-a-given-shard
[14:24:23] <KamZou> i've got to know if the dedicated-server's volumetry is the only reason why we didn't use the balancer right now
[14:24:54] <KamZou> If it's i'll activate it with this kind of configuration (max storage size / shard)
[15:36:10] <Derick> in a replicaset, all mongods need to talk to eachother
[15:36:24] <Derick> but the don't talk to mongod's in a different shard's replicaset
[15:36:29] <tiller> yes ok. I misunderstood what you said :)
[16:30:55] <nollidj> i'm interested in mapping homogeneous documents in a collection to a stream of homogeneous documents, which will be inserted into a different collection. is mongodb's map-reduce function the right mechanism for doing this?
[16:45:00] <TehShrike|Work1> What happens if ensureIndex is called for a key that already has an index, but with different options than were used on the first index?
[16:51:31] <Derick> TehShrike|Work1: afaik, it creates another index - but test it?
[16:52:05] <TehShrike|Work1> The docs say about ensureIndex "Creates an index on the specified field if the index does not already exist."
[16:52:29] <Derick> it takes less time to test than it takes to find it in the docs though ;-)
[16:52:37] <kali> Derick: i think it is silently ignored :)
[16:52:49] <kali> TehShrike|Work: i think it is silently ignored
[16:53:10] <TehShrike|Work> Derick: not really, I don't know how to tell the difference between an index being rebuilt versus being silently ignored
[16:59:39] <Nodex> you can also tell if it's building one with currentOp() iirc
[17:02:08] <TehShrike|Work> Looks like it silently ignores it, even if the options are different. Good to know
[17:12:47] <cheeser> because the name is already there.
[18:16:02] <Veejay> Hi, if I have a MongoDB replica set running locally, how can I manually kill the primary or make it so that it becomes unavailable (to see if the re-election procedure happens as expected)?
[19:02:40] <nollidj> is there a good way when running the mapReduce function to have the resulting records merged with an existing collection rather than overwriting it?
[19:03:52] <nollidj> ah, maybe the action key will do it
[19:05:20] <gregmash> does anybody here know about mongoose?
[19:06:44] <Nodex> gregmash : best to just aks the question ;)
[19:07:05] <gregmash> i need help cloning data in mongodb using mongoose
[19:07:17] <gregmash> and if it can be done with node streams
[19:07:30] <gregmash> i have not seen an example of streaming data into mongoose
[19:08:27] <nineteen1ightd> I have a document with a field that contains an array of subdocuments. Those subdocuments contain a field that itself has an array of subdocuments, e.g. {foo: [{bar: [{baz: True}]}]}. I can find documents in the collection easily enough based on a value in the inner most subdocument, however, I really want to apply updates to a particular set of those inner most subdocuments...
[19:10:44] <nineteen1ightd> I tried something like db.coll.update({'foo.bar.baz': True}, {$set, {'foo.bar.$.qux': true}})
[19:11:17] <loopj> does mongo have any way to sort a collection by the length of an array in each document yet?
[19:11:42] <loopj> we dont have a seperate count field, and I dont want to make one for this task (building an admin page)
[19:11:42] <cheeser> you could probably do that using the aggregation framework
[20:04:51] <wc-> hi all, im having some issues trying to do a disctinct query with 2 fields using the aggregation framework
[20:05:02] <wc-> i feel like im over complicating things
[20:05:56] <wc-> in sql it would be like a count with 2 columns
[20:09:38] <GM001> Hello everybody, does anybody know how to check failover history
[20:10:19] <GM001> to check when there was flips between primary and secondart servers
[21:27:41] <tripflex> hey guys so wondering what the "best" and most efficient way to do this would be
[21:28:32] <tripflex> I have a collection that has a value "status", status is either equal to complete or incomplete, in building my web app to output into tables i'm currently using two find calls but my assumption is this isn't the most efficient way to do it
[21:30:23] <jmagder> Good afternoon (EST). Been playing with mongodb for a few weeks now and it is amazing. Been learning about improving search queries with hints, but I can't seem to get a hint to apply
[21:30:46] <tripflex> now that's using node, express, and mongoose
[21:30:52] <tripflex> but it's basically a find inside of a find
[21:31:15] <tripflex> so I can pass the returned data in two objects, completedata and incomplete data, and then use swig template to output the tables
[21:31:15] <jmagder> I have a compound index consisting of a 2D key, followed by a multikey index.
[21:32:34] <jmagder> I'm putting in a $hint: { random_point: '2d', tags: 1}
[21:32:49] <jmagder> But it always uses a GeoSearchCursor, with isMultiKey set to false.
[21:36:58] <tripflex> here's a pastebin that should help identify my question:
[22:55:44] <djlee> If i have two mongo _id's. Is there any such thing as a "lower" id? Like with a integer id in mysql, 10 is smaller than 15. Is there any such thing in mongo?
[23:03:47] <Joeskyyy> djilee: Not really… the objectID is compromised of a few factors, such as unix epoch, procID, and a random value counter
[23:08:12] <djlee> thanks Joeskyyy, suppose i'm looking for something that mimics mysql's autoincrement field, and theres a good reason mongo doesn't have such a thing. I'll have to start thinking about solving my problem in a different manner
[23:10:40] <tripflex> at least to point you in the right direction
[23:12:00] <nineteen1ightd> Is there an update I can do to $set a new field on all embedded documents in an array?
[23:12:18] <nineteen1ightd> My research, thus far, says no...
[23:12:33] <djlee> i don't think there is, but is there a way of implemnting a bidirectional unique constraint in mongo? So if FieldA is 1 and FieldB is 2, i cannot then enter FieldA:2, FieldB:1. So basically the uniqueness would be on both 1,2 and 2,1 ?
[23:14:03] <nineteen1ightd> I'm not terribly familar with Mongo, however, I'm guessing a unique index on (FieldA, FieldB) is unique on that ordering of their values?
[23:15:27] <djlee> nineteen1ightd: yep, uniqueness is only on the order you specify from what i can gather from my tests. Which makes sense since first and foremost it's an index
[23:16:12] <djlee> just going through all the possible good solutions i can think to my problem, before i resort to coding something a little less nice and performant to handle things.
[23:17:10] <djlee> nineteen1ightd: not sure if this helps you but: http://stackoverflow.com/questions/6758339/updating-embedded-document-property-in-mongodb
[23:22:38] <nollidj> mongo automatically indexes the _id field of documents, right?
[23:23:18] <nollidj> so if i have _id fields set to values like { foo : bar, baz : { quux : blech } }, i should see that the index is being used when i make a query like { _id.foo : bar } }
[23:25:08] <nollidj> my query is more complicated than that (uses $or more than once), so i'm checking to see if a simpler query does
[23:26:41] <nollidj> when "nscannedObjects" is the cardinality of your collection, that's bad, right?
[23:27:29] <nollidj> i can't confirm that an index is being used --- indexOnly is false, but that makes sense since the query i'm running targets parts of the _id field
[23:27:45] <Joeskyyy> you can tell from the "cursor" field
[23:29:53] <nollidj> bizarre. given documents like { _id : { key : value, key : { nested : stuff }, ... }, value : thingy }, queries like { "_id.key" : value } don't appear to be using an index
[23:29:57] <nollidj> still, that's something i can fix. good to know
[23:30:20] <nollidj> Joeskyyy: thanks for the pointers
[23:52:33] <Joeskyyy> Ahhhh, I found it nollidj: http://docs.mongodb.org/manual/core/index-single/#indexes-on-subdocuments
[23:52:56] <Joeskyyy> Querying the subdocuments must match the ordering, which makes sense when you think about how the indexing is working on something like that