[03:02:14] <JoeyJoeJo> How can I select partial matches? For example, if a document is {abcd:efghi}, how can I select it by just searching for db.collection.find({abcd:efg})?
[03:33:35] <JoeyJoeJo> IAD: Thanks, I didn't know about $regex
[03:36:41] <toothr> does a full scan unless you use a case sensitive rooted (eg: using ^) regex
[03:39:22] <JoeyJoeJo> One more question - I have 4 sharded servers and a collection with about 183 million documents. The servers are each 32 cpu cores, 256GB of RAM and raided SSDs (not sure which level). I did a query which resulted in 3304 results, but the query took about 20 seconds. How can I speed that up?
[03:40:10] <JoeyJoeJo> The query was db.data.find({"date":"2012-12-02 10:27:45"}).count()
[10:52:57] <ragsagar> kali, In which operator can I use it like that? I want the count of objects processed in a particular year.
[10:53:20] <kali> ragsagar: $project the year, then $group on the value
[10:53:47] <ragsagar> kali, thanks, let me try out.
[10:55:58] <ragsagar> kali, can I use '$year': '$processed_time' in $project because I am getting error $expressions are not allowed at the top level of $project.
[11:11:56] <jwilliams__> i follow the doc at http://docs.mongodb.org/manual/tutorial/convert-replica-set-to-replicated-shard-cluster/
[11:12:57] <jwilliams__> and setup a replica set by issuing db.runCommand({"replSetInitiate" : {"_id" : "first", "members" ...});
[11:13:12] <jwilliams__> it works as described in the doc.
[11:13:27] <jwilliams__> but how can i publish an existing collection to that replocation set?
[11:14:15] <jwilliams__> the doc descirbes creating a new collection. but what i need is replcating an existing collection.
[11:18:32] <ragsagar> kali, Is it possible to use $match operator to filter based on an object id
[11:33:40] <oskie> hello, i've done a snapshot backup (LVM), and now I want to run mongodump to make smaller backups. MongoDB will think it has shut down incorrectly. Can I just run 'mongodump' with --dbpath on the offline instance data?
[11:46:12] <oskie> I guess I could just do 'mongodump' on the live database instead of going LVM route, but IIRC, that would take ages which is why I ended up with --forceTableScan which is bad.
[11:46:40] <ragsagar> Is is possible to concatenate two variables given by $project operator inside $group in aggregation framework?
[12:28:45] <remonvv> ragsagar, $concat is supported in 2.3+ iirc
[14:48:57] <revoohc> anyone have any metrics on how much overhead there is in a shared environment vs just a replica set? i.e. how much does running through mongos cost?
[14:54:03] <NodeX> mansoor-s : I would avoid companies that can't even create a working website!
[15:01:57] <tom0815> hello, i have a question related to replicaset: in my setup i have 3 mongod nodes + 1 mongod in another data center on a different country. the three nodes are in one data center and they are syncing fine, but the node in the other data center has not sync at all. i checked the network with ping (latency ~ 100ms) and nmap (ports are opened in both directions). can someone give me a hint what goes wrong and how to go on? mongod version is v2.2.2
[15:02:24] <karptonite> if I am doing a db.collectionname.find().count(), is there any increase in speed if I specify in the find query a list of fields with just _id in it, since I'm not really retrieving any records at all? or should speed either way?
[15:03:17] <NodeX> it will save the default first cusor size over the wire
[15:03:28] <NodeX> so it will be faster as it's not transferring that data
[15:11:00] <karptonite> NodeX: not sure I understand. Are you saying that it will be faster if I DO include the query limiting the fields?
[15:13:42] <NodeX> yes because it's sending less data on the initial return
[15:14:01] <NodeX> that's what "so it will be faster as it's not transferring that data" means ;)
[15:15:53] <karptonite> NodeX: thanks--Since adding the query means transferring a bit more on the way TO the server, I wasn't sure. Is this a substantial amount of data? It sounds like something that would be negligible, but if it could be substantial, i could easily add it to my counts.
[15:24:09] <NodeX> it depends how much data is in your documents
[15:24:47] <NodeX> some people say that over-optimisation is a bad idea, I say there is no such thing as over optimisation and every call and query should be as fast as it can be
[15:25:59] <kali> and all general statements are wrong.
[15:26:37] <NodeX> which is kinda the point or the concept to most nosql problems...
[17:57:12] <owen1> let's say one host in my replica died. what is the procedure of bringing him back? rm -r /data/db and start mongod?
[18:05:21] <JakePee> trying to write a script that makes updates, and then waits for the oplogs to catch up. Is 'sleep(ms)' database related or does it only apply to the script?
[18:06:20] <JakePee> that is, if i add `sleep(1000)` to my script, does it impact the db
[18:07:47] <JakePee> just wanted to make sure it wasn't calling this http://docs.mongodb.org/manual/reference/command/sleep/
[18:22:36] <CrawfordComeaux> Quick poll: Is this something you'd fund to get to play with and if so, how much would you put in? If not, what could be offered to change your mind - I want to setup a crowdfunding campaign for setting up a system that lets devs play with all social media data related to the super bowl or geotagged as coming from New Orleans from 1/26-2/4. Devs would be able to submit their own data processing components (for www.storm-project.org) or dashboard
[18:22:36] <CrawfordComeaux> widgets w/custom queries attached to them.
[18:36:55] <Xat`> which mecanism/server provides routing between members of replicaset ?
[19:14:16] <kali> Xat`: the idea is to give the list of the replica nodes when you start the client, instead of just one node
[19:14:38] <kali> Xat`: the client is responsible for finding a working node
[19:17:18] <bean> i'm also doing stuff with replicasets right now -- I have one DB that is the current master, but we want to add some redundancy to it. Is the best option to just let it connect to the node and have the client figure it out? One of the guys here wants to use mongos in front of the RS, but we're not sharding at all so I don't know how much sense that makes.
[19:20:53] <linsys> Bean: you need to define the nodes in the client driver, all of them
[19:21:14] <linsys> bean: that way the driver can figure out which is the master and which node has the least latency when using SlaveOK
[19:21:45] <linsys> bean: using mongos could be important if you plan to shard one day... but I agree it isn't necessary yet..
[19:22:00] <bean> linsys: he's saying he doesn't want to make code changes
[19:22:31] <linsys> Well tecnically it isn't code... it should be a configured value in a config file.. but I guess it all depends on how you guys write code...
[19:23:12] <linsys> You should never have to make code changes when changing mongodb servers, like if you have a dev, pre prod and prod environment you want to have the flexability to change the nodes without changing code.. but that is just my opinion :)
[19:25:46] <linsys> Just be aware you will need to setup config servers if you want to use mongos
[19:26:06] <linsys> I don't think the Jira ticket has gone though which allows mongos to connect to a single replica set, you still need to setup config servers
[19:26:33] <linsys> You can track the activity here https://jira.mongodb.org/browse/SERVER-1594
[19:26:49] <linsys> The good thing, if you go this route you will be in a position to shard quickly
[19:31:05] <kali> i prefer 10gen guys to spend their times on useful stuff :)
[19:32:51] <kali> bean: seriously, once your app configuration is done properly, it's *really* easy to have code compatible with whatever setup variant you'll have
[20:36:04] <lineux_007> hey, i'm trying to recover space from a mongodb installation. dont have enough space to run repairDB. can i copy the db files of the db i want repaired to another instance, repair it there and copy and replace it back on the original instance?
[20:42:58] <crudson> I think that should work safely with directoryperdb. Shutdown first of course (and keep copy of original to be safe).
[22:55:16] <steverabouin> db.version() will tell you the server version
[22:57:07] <mgallardo> thanks @steverabouin... I am trying to update mongodb's server version to 2.0.0 with no success (using port), do you have any idea how can I do that?
[22:57:54] <mgallardo> if I do 'sudo port installed mongodb' I get 'mongodb @2.2.2_0 (active)'... and if I do db.version I get '1.4.0'
[22:58:20] <steverabouin> have you restarted the daemon?