[06:29:55] <russum> Hi, I just did a db.setProfilingLevel(2) on a small collection (~1k documents) and then when I did db.system.profile.find() - mongo.exe would just crash, that was 2.4.4, I now updated to 2.4.9 and it does not crash anymore but the following error shows up:
[06:29:55] <russum> Mon Feb 17 01:19:47.695 Error: 16863 Error converting /sta/ui in field CRN to a JS RegExp object: SyntaxError: Invalid flags supplied to RegExp constructor 'ui' at src/mongo/shell/types.js:612
[06:30:42] <russum> the CRN field has data in the following format: "123.201400" if that matters…
[07:01:44] <daniel-s> Do people normally use mongodb from the execuatable, or through bindings from another language, like PHP or Python?
[07:02:30] <Garo__> daniel-s: php, python etc have their own mongodb drivers which are used to connect to the database from code
[07:02:51] <daniel-s> I think that's the word I should have used, driver, not bindings.
[07:03:20] <daniel-s> I mean, I will sometimes access my databases through the mongo executable, if I want to manually debug something or look through data.
[10:34:50] <orweinberger> I just pushed a few millions of documents to a collection and only then enabled sharding on it. I would like to check the status of the sharding, I'm using sh.status() and I can see that I have chunks: shard0001 - 1, shard0002 - 229. The third shard does not appear on that list. When I run sh.isBalancerRunning() I get 'true'. What should be these outputs when shard balancing is complete?
[10:37:36] <kali> orweinberger: well, it should be roughly even, but it can take hours to balance
[10:38:01] <kali> orweinberger: there is a changelog collection in the config database that you can check
[10:39:57] <orweinberger> kali, is it possible to know how many documents I have on each mongod instance? When I try to connect to one (using umongo) I see the entire lot of documents, not only what's on that specific shard
[10:41:29] <kali> orweinberger: well, db.collection.getShardingDistribution() should give you that
[10:42:13] <kali> orweinberger: but what you describe sounds weird. if you cannect to the mongod hosting a shard and query a sharded collection, you should only see a part of the collection
[10:44:07] <orweinberger> kali, yes, you're right I was wrong about that part.
[10:44:12] <orweinberger> I can see it working now, thanks :)
[10:50:08] <Gleb`> Can I query a model and select objects referenced by id at the same time? So that i can do something like user.name.first_name where name is an object referenced by ObjectId on the user
[11:56:48] <gmg85> I would like to query for a field in several documents of the same type and get the field values returned in an array
[11:57:01] <gmg85> is it possible to do this without looping?
[12:01:54] <BurtyB> gmg85, depending on what you want distinct would return them in an array
[12:08:17] <gmg85> BurtyB, is it possible to use distinct like this db.collection.distinct('field1',{field2:field2Val},function(err,arr){})
[12:10:05] <BurtyB> gmg85, it just takes a field and the query
[12:13:21] <orweinberger> I have a 14GB mongo data dump taken from a separate database. Now I have a new set of 3xcfg servers, 1xmongos, 3xmongod that I want to load the data dump to. However, I would like to do so in a way that will push all the data to the shards respectively. I want to avoid pushing all data to 1 mongod and then to have the mongos rebalance everything. Is there a way for me to do it?
[12:34:06] <MmikePoso> Hello! Is there an easy way to 'replay' traffic recorded against mongod instance? I'm recording the traffic with mongosniff.
[12:47:12] <Garo__> MmikePoso: the mongodb wire protocol is quite simple. if you know node.js then you can take a look this tool which I've written. it's not ready for your problem, but you should be able to modify it quite easily to your needs: https://github.com/garo/node-mongodb-wire-analyzer
[12:51:03] <orweinberger> I have a 14GB mongo data dump taken from a separate database. Now I have a new set of 3xcfg servers, 1xmongos, 3xmongod that I want to load the data dump to. However, I would like to do so in a way that will push all the data to the shards respectively. I want to avoid pushing all data to 1 mongod and then to have the mongos rebalance everything. Is there a way for me to do it?
[12:53:25] <kali> orweinberger: i think that if you call enableShard and shardCollection before running mongorestore, it should do just that (might work better without the --drop option but i'm not sure)
[12:54:41] <orweinberger> kali but the db is not yet created on the new infrastructure, so I cannot run shardCollection. If I create it before restoring and add a 'dummy' record with the same structure as the real data, would that solve it? Will I be able to restore it if I do so?
[12:56:44] <kali> orweinberger: I don't think you need to go through creating dummy stuff. just making the call on non-existing database should be enough to create the metadata in the configuration database
[12:58:31] <orweinberger> kali, thanks a lot, I'll give it a try now! :)
[13:04:54] <mboman> Anyone know of any (cheap) mongodb hosting for large collections (TB of data)
[13:05:41] <kali> TB and cheap in the same sentence ? :)
[13:07:11] <mboman> kali, and cheap is a relative question
[13:18:22] <Cahu> hi, I need to apply a function (javascript) to a particular entry in a document matching a query and update the value with the output of that function
[13:18:29] <Cahu> what would be the best way to do this?
[14:21:18] <|Lupin|> ii mongodb-10gen 2.4.7 An object/document-oriented database
[14:27:10] <_boot> has anyone else experienced terrible export speeds when talking to a mongos?
[14:28:25] <_boot> it's not showing in the currentOp either, I'm running with a query and it's indexed
[15:06:20] <bobinator60> is it possible to make a covering index for this document http://bpaste.net/show/VOZu6n4hntSaNdSHgo5g/ with $elemMatch (kind:foo, value:bar) $AND owner_id:someObjectID?, and return just the _ids of those that match?
[15:08:10] <bobinator60> i have this index, but it does a table scan http://bpaste.net/show/7ryocDFMcD6TURWRgjTG/
[15:12:06] <Nodex> the index should be {kind:1,value:1,owner_id:1}
[15:12:42] <Nodex> the index should be {"attributes.kind":1,"attributes.value":1,owner_id:1}
[15:13:16] <bobinator60> i tried that too, and it still scanned the disk for the ids
[15:13:56] <bobinator60> i'm looking at this in the docs: " If an indexed field is an array, the index becomes a multi-key index index and cannot support a covered query"
[15:14:32] <bobinator60> but I can't tell if its referring to a plain array [a,b,c] or an array of embedded docs, or both
[15:14:48] <Nodex> an array of embedded docs is an object not an array
[15:15:04] <Nodex> attributes : {} vs attributes:[]
[15:15:47] <bobinator60> Nodex: so are you saying it should work? then why is indexOnly: False ?
[15:16:21] <bobinator60> here's the query & the query plan http://bpaste.net/show/0mDdh2ZBPXbvOm9hwcjP/
[15:17:53] <Nodex> I am saying it needs to be an object not an array
[15:19:27] <bobinator60> sorry to be so dumb here, but what needs to be an object not an array? i still don't understand what I'm doing wrong
[15:30:14] <Killerguy> because I added a shard that is 1 instance replicat set
[15:30:19] <Nodex> best to use the right tool for the job ;)
[15:30:24] <Killerguy> and now my replicaset is 3 mongo instrances
[15:30:53] <Killerguy> but mongo router keep the shard and 1 instance in the replicatSet
[15:30:53] <bobinator60> Nodex: i have been bit over and over again by these kinds of cases with mongo.
[15:31:51] <|Lupin|> mongoexport --host=elmongodbdev.cines.fr --collelestore.json xmodule 2>&1 | less
[15:32:40] <Nodex> bobinator60 : in 4 or so years I have never had such problems, I model my data differently though so that's probably why
[15:34:18] <bobinator60> Nodex: i would denormalize the data into master/detail if mongo supported transactions
[15:34:38] <quickdry21> Question - when I add a new shard (replica set) to an existing cluster, will the usernames/passwords for each database get set from the other shards, or do I have to do it manually?
[15:35:01] <Nodex> I don't know your data structure so I can't comment. Mongodb doesn't claim to be a silver bullet, perhaps it's model just doesn't fit your app
[15:38:03] <Joeskyyy> quickdry21: The recommended security for sharding and replsets would be a keyfile
[15:38:30] <Joeskyyy> see this doc: http://docs.mongodb.org/manual/core/inter-process-authentication/#replica-set-security
[17:09:26] <sflint> but after the connection to mongo...nothing....doesn't create the collection either
[17:09:38] <sflint> this .csv is large around 1.2GB.....
[17:13:35] <jaraco> We have a server in ROLLBACK state. It's stuck there because it has a bunch of data we care about that didn't get synced with the current primary.
[17:13:52] <jaraco> We want to make that host primary again (and forget the other primary was ever promoted).
[17:15:40] <jaraco> Though we want to make it as short as possible.
[17:15:49] <jaraco> We do have a commercial support contract too.
[17:17:01] <sflint> there are 2 options that I can think of...I have never tried them in practice so you might want to try to test somehow. But I believe if you cahnge the rs.conf() to where the roolback is highest priority.
[17:20:39] <sflint> I think you are going to have to recreate the cluster seperatly starting with the rollback node.....you could take it out of the set and build a new replica set starting with it as the primary
[17:20:39] <jaraco> sflint: if we set that host to highest priority, will it know not to be in the rollback state?
[17:23:01] <sflint> is there anyway you can take the rollback down
[17:23:12] <sflint> stand it up by itself and recover the data?
[17:23:55] <sflint> if you start it outside of replica set mode you will be able to get to the data on it
[17:26:08] <jaraco> We've done that. Now it's in STARTUP2 state
[17:26:23] <Veejay> Hi, is it possible to clone a collection from one mongo instance to itself? i.e. making a copy of a given collection with another name?
[17:26:40] <jaraco> That is, restarted the rollback node with the other node offline.
[17:30:25] <groundup> I have a collection called "features" and in that, each document has {_id, user, place, feature, value} I tried to do feature.ensureIndex({user: -1, place: -1, feature: -1}, {unique}) but I still get duplicates when I do save()
[17:49:20] <groundup> With an upsert I am still getting the error
[17:51:31] <groundup> Here's the parameters: user: "2th7y", place: "AKdsJ", feature: "Good for kids", value: 1
[17:53:16] <jaraco> sflint - thanks for the help. I have our commercial support rep now.
[17:59:45] <sflint> jaraco....let me know what they advise
[18:01:52] <groundup> I'm using 2.4.3, so it has upsert. Searching for the answer on Google.
[18:08:23] <groundup> Switched back to save() from update w/ upsert. Shows the duplicate key error (now it doesn't show nulls, but the actual values).
[18:09:49] <jaraco> sflint: We needed to run db.replset.minvalid.remove() on the target host's local DB (in standalone mode) to force it to disregard the minimum valid timestamp. After doing that, we restarted it and the arbiter and the repl set came back online.
[18:31:09] <groundup> Tried adding _id to vote{} but that didn't change anything.
[18:42:57] <groundup> This is around the point where I want to take my computer outside and put bullets in it
[18:43:46] <groundup> Her name is normally Adell, but I'm about to change it to Old Yeller
[19:02:05] <groundup> So save() isn't working but I finally got update() to work.
[19:11:25] <rpcesar> hello, I am running into this issue with an aggragate query in the group statement. paste for function here: http://pastie.org/8742971 , the error I am getting is ""A pipeline stage specification object must contain exactly one field.", but I don't understand the reason for this as it is similar to code I have written in the past
[19:11:57] <rpcesar> note that function just builds the pipeline array. removing the "group" statement works (well, with the expected duplicates due to not being grouped)
[19:16:19] <rpcesar> anyone able to explain this to me?
[23:05:37] <bcx> Are there common things I should check to understand why it's slow?
[23:05:53] <bcx> Is there a way to know what's going on here? { Site.users.analytics_id: "2f7d84ef4995da2f2c8d202217c9f9d622be76df" } ntoreturn:1 nscanned:1 nreturned:1 reslen:166 110ms
[23:06:13] <bcx> is what I see in the logs, it doesn't look like it's scanning more than 1 doc.
[23:06:36] <rafaelhbarros> what's the size of that document, if you don't mind me asking