[00:12:02] <jamesaanderson> If I have a users collection that looks like this: http://pastie.org/9191184. I can't seem to figure out how to select a post by id and return only that post. What am I missing?
[00:18:30] <dgarstang> dangit. now I can't add a shard. ""errmsg" : "couldn't connect to new shard socket exception [CONNECT_ERROR] for rs1/mongo-shard-shard0-rs1.prod.foo.com:27017""
[00:19:25] <jamesaanderson> joannac: Thanks that's been frustrating me for a while
[00:20:34] <dgarstang> the mongos server obviously needs to be able to reach the shard on port 27017. Does the shard need to communicate back to the mongos box?
[00:22:29] <joannac> ...yes? otherwise none of your queries will return results?
[00:24:14] <dgarstang> joannac: i mean... do I have to open a firewall hole to allow shard to communcate to mongos in addition to allowing mongos to reach shard
[00:24:22] <federated_life> dgarstang: yea..once you get it up and running, you'll notice that each mongoD of the replica set of each shard keeps connections open to the config servers , the mongoS
[00:25:11] <dgarstang> federated_life: in this particular case, I'm running the addshard command and getting a connect error. Running tcpdump on the shard box though shows that it's receiving the traffic from the mongos box
[00:26:04] <dgarstang> your saying the shards need to talk to the config servers too? Yikes.
[00:30:09] <dgarstang> Also allowed shards to talk to mongos. Didn't help.
[00:31:02] <joannac> that error looks like a problem connecting from mongoS to mongoD to me...
[00:32:32] <dgarstang> joannac: as I said above, tcpdump shows that the mongod shard is receiving traffic from the mongos box, so it's not a firewall/connectivity issue. It's also logging the connection but nothing else.
[00:33:20] <joannac> can you connect with a mongo shell?
[00:34:16] <dgarstang> joannac: yep... mongo --host mongo-shard-shard0-rs1.prod.foo.com --port 27017 works
[00:34:26] <dgarstang> ran that from the mongos box
[00:34:37] <dgarstang> so, mongos box can connect to shard box
[00:35:26] <dgarstang> but again, running sh.addShard("rs1/mongo-shard-shard0-rs1.prod.footest.com:27017") results in "errmsg" : "couldn't connect to new shard socket exception [CONNECT_ERROR] for rs1/mongo-shard-shard0-rs1.prod.footest.com:27017"
[00:43:32] <dgarstang> joannac: actually, no. There's nothing in the mongo doc at http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/ about that. I did see someone saying you had to run rs.initialize() first but when I did that it complained mongod had not been started with the replset option.
[01:09:56] <joannac> oh he's gone, but https://jira.mongodb.org/browse/DOCS-2561
[01:12:30] <joshua> Its a good night to remove 50 million documents from a db.
[01:20:32] <joshua> 5-6k documents deleted per second, this should only take another couple hours. heh
[01:30:56] <nullne> morning,i met a problem but got no proper resolution via google.
[01:31:52] <nullne> i am running fedora 20,and installing the latest version of mongodb, I was able to run the mongod daemon as a service without error the very first time but when I shut down my machine and came back, the service refused to start due to some failure.
[01:33:03] <nullne> this is error log in /var/log/mongod/mongod.log
[01:33:07] <nullne> ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: No such file or directory
[01:34:32] <cheeser> looks /var/run/mongodb is missing
[01:34:33] <nullne> when i start the mongos :sudo service mongos start ,i got this erro message : Job for mongod.service failed.See 'systemtcl status mongos.service' and 'journalctl -xn' fro details
[01:35:38] <nullne> i follow this resolution http://stackoverflow.com/questions/23086655/mongodb-service-will-not-start-after-initial-setup, and remkdir the mongodb
[01:36:09] <nullne> yes ,there is no mongodb directory
[01:37:22] <nullne> cheeser, do you know how to solve it ?
[08:27:58] <rspijker> try mapping str over the arrays first
[08:28:19] <rspijker> what you want to comapre is the string content of the ObjectId and not the actual Object
[08:31:42] <rspijker> then you’ll end up with a list of stirngs though, which might be ok, again, depends on what you want exactly
[08:32:30] <justind> Yeah I was thinking of doing that, but I was hoping there would be a more elegant solution.
[08:32:54] <justind> Thanks for the help, appreciate it very much.
[08:33:21] <rspijker> I’m not 100% up-to-speed on Lo-dash, so there might be some fancy-ness I don’t know about
[08:33:53] <rspijker> but I’m not aware of any differenceBy function or anything like that, where you can pass in a comparator-function, which is kind of what you want…
[08:34:03] <rspijker> I suppose you could just write it yourself as a wrapper
[08:47:36] <jacksmith> I need some advice, I have a big data coming from some GPS devices, which i need to store it for months and analyze it, currently i am using MySQL but it is very slow for this work, can mongoDB can helpfull to me in this case ?
[08:49:48] <kali> jacksmith: mongo is good for small, fast, targetted requests. it should be fine for collecting the data. but if you plan big scala data analysis, you may want to complement mongo with something from hadoop (like hive or pig) or spark/shark
[08:52:12] <jacksmith> @kali i am talking of DB not webserver
[09:03:11] <jacksmith> I need some advice, I have a big data coming from some GPS devices, which i need to store it for months and analyze it, currently i am using MySQL but it is very slow for this work, can mongoDB can helpfull to me in this case ?
[10:37:48] <talbott> if a user has "dbAdminAnyDatabase"
[10:37:55] <talbott> and "readWriteAnyDatabase" roles
[10:38:27] <talbott> so they need some additional role to be able to authenticate to the db in the first place, instead of having to authenticate against admin and then change
[10:57:20] <rspijker> talbott: they will need to auth against admin
[10:58:06] <rspijker> I think you can set up users on specific dbs as well that inherit from the admin db, but you would have to check the docs for details
[11:00:45] <netQt> Hi all. I need to traverse very large db and make updates on each row. It would take to much time to select all data then process. Is there a way to process as soon as selecting?
[11:01:23] <netQt> I'm trying to avoid using limit
[11:10:15] <rspijker> it will perform the select first (I believe), so the query will still take time. But it won’t get all of the documents from the database, it just gives you this cursor into the resulting set
[11:12:33] <netQt> so I hope that won't take large amount memory, right?
[11:14:01] <rspijker> on the server side it will take the memory that it requires...
[11:14:19] <rspijker> the kernel will page stuff into RAM as needed
[11:14:37] <rspijker> in order to perform the query, the data will have to be checked...
[11:14:54] <rspijker> on your *client* though, it’s up to your application to handle it correctly
[11:15:14] <rspijker> that is, if you iterate over the cursor, technically you would never have to have more than 1 document in memory at the same time
[11:15:54] <netQt> oh, than I can't go that way. That's what I;m trying to avoid
[11:17:16] <rspijker> then chunk it with skip and limit
[11:17:31] <rspijker> but if your indices are bad, you’ll still end up with a large memory footprint
[11:17:37] <rspijker> since the query still needs to be run...
[11:19:43] <rspijker> or if you have a field that you know to be monotonically increasing (like an ObjectID), you could use findOnes with a $gt on the id field…
[11:20:11] <rspijker> but this is all very contrived… You should just let the kernel and mongod deicde what to do, trust me when I say they’ll be better at it than you
[11:27:13] <netQt> I found this query streaming http://mongoosejs.com/docs/2.7.x/docs/querystream.html
[11:30:02] <rspijker> that’s mongoose… it doesn’t say what it does under-water
[11:30:58] <netQt> yea, but I'm fine with using that :)
[11:31:30] <netQt> I'll try it now on large data to see how it behaves
[11:32:20] <rspijker> hmmm, apparently cursors behave a bit better nowadays: http://docs.mongodb.org/manual/core/cursors/
[11:33:04] <rspijker> so the cursor approach should work fine as well
[11:33:15] <rspijker> as long as you’re not sorting on an unindexed field
[11:47:21] <Fiibar> hi, how can i check for double uniqueness? i have a mongodb document in my symfony project. i want to have a check on two fields for uniqueness. how? mongdb/unique can be done on one field by default, right?
[13:05:00] <Industrial> Hi. I'm trying to build an export feature (to CSV) by merging several streams that come from mongodb aggregations. I'd like to support progress reporting while the export is running in the browser, so I need to know howmany documents will be streamed from the aggregation and at what point it's currently at (So I can send 20% 30% 40% etc to the browser). How would I do this?
[13:05:44] <tscanausa> Industrial: I am pretty sure you cant.
[13:05:47] <cheeser> aggregate out to a collection. count. export.
[13:38:17] <Industrial> .. right so basically I cant count howmany left until its done
[13:39:33] <Industrial> tscanausa, Is there an event for this time?
[13:43:53] <Industrial> tscanausa, so the method .count() is only put on the instance of Cursor after .. what event?
[13:48:12] <tscanausa> after the aggregation has fully completed
[13:58:26] <Industrial> tscanausa, so is that the 'end' event on the cursor object?
[13:58:41] <Industrial> its a stream, so its already sending output before it is done, instead of loading everything into memory, right?
[13:59:11] <Industrial> OR is it already done in mongodb with the aggregations
[13:59:17] <Industrial> before it sends the cursor object?
[13:59:23] <Fiibar> In Symfony config for MongoDB Doctrine bundle there is an option for "default_database" is there an easy way to set another database? Like different databases for each user for example.
[14:52:42] <q85> I'm curious if the config servers are all up and a mongod is down, will the upgrade to the meta-data still complete ok.
[14:56:03] <tscanausa> from the release noted it looks like the upgrade just changes information on the config servers.
[15:25:46] <q85> tscanausa: that's also what I'm thinking. I'm going to assume the upgrade was completed successfully.
[15:45:39] <dgarstang> Confused about shards and replicasets...
[15:49:41] <dgarstang> Does each replicatset gets it's own mongod process?
[15:51:19] <cheeser> each replicaset *member* gets its own mongod
[15:53:59] <dgarstang> cheeser: ok, that's what I meant to say, thanks
[16:42:24] <zerooneone> hi there, i'm having errors trying to build the 26compat cxx driver on ubuntu 12.04 with errors like 'make_shared' is not a member of 'boost'
[16:42:56] <zerooneone> it's failing on replica_set_monitor.cpp
[16:43:13] <zerooneone> here's a paste bin http://paste.ubuntu.com/7493683/
[16:43:49] <zerooneone> i wonder if anyone has any suggestions on how to resolve this issue?
[17:04:17] <jimpop> does sharding have any benefit for small (<2GB) datasets?
[17:19:38] <jimpop> or do I need an explicit phrase within the inner quotes?
[17:41:32] <dgarstang> Argh. I'm just not quite getting sharding and replicasets. If I have a shard, split across two boxes... what do I have? I have a single shard, correct? How many replicasets would I have? one or two?
[17:42:12] <cheeser> you'd have 2 shards and 0 replicas
[17:42:36] <cheeser> typically each shard has its own replica set
[17:46:14] <cheeser> yes. because they've set up a replica set for each shard.
[17:46:45] <dgarstang> i thought the shard just had some number of replicas. Why the primary/secondary stuff?
[17:47:11] <dgarstang> maybe I'm getting ahead of myself. but...
[17:47:21] <pmercado> hi, how to query with an id ???
[17:47:27] <dgarstang> one replicaset. So, all the boxes in the same shard would have in mongodb.conf replSet = samething
[17:47:42] <dgarstang> where something is the same
[17:48:16] <pmercado> find( { _id:ObjectId("53753204abce5effbeb3ffa6") } ); <--- in console, but using java driver ?
[17:49:18] <pmercado> o.append( "_id", new ObjectId( "id_string" ) ); <--???
[17:49:24] <dgarstang> cheeser: implementations I've looked at earlier only have two nodes in the same shard. That's the minimum? one primary and one secondary?
[17:51:21] <cheeser> you should have 2 secondaries typically
[18:03:42] <boomy> Hey guys, I would I calculate the rank of each item in a collection and add that as a field to the entry when I retrieve them?
[18:33:35] <kali> alex_javascript: it's shown in the startup logs too
[18:38:27] <alex_javascript> Is it supposed to be in YAML format?
[18:48:24] <dgarstang> Next! New mongo issue.... "[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)" ... what's that mean?
[19:20:31] <dgarstang> I just set up a shard... and I think it's working but sh.status() is showing me nothing...
[19:25:57] <federated_life> dgarstang: pastebin the output
[19:30:58] <federated_life> yea, its the only place you can run it
[19:31:50] <Frozenlock> Will a capped collection be faster than a normal collection where I manually remove the oldest element? (say after 2-3 complete rewrite)
[19:32:04] <dgarstang> http://pastebin.com/zMbMV8bc .... that shard isn't the right one. it's from an earlier attempt. the replicaset is called rs0
[20:26:18] <pmercado> https://github.com/mongodb/morphia/wiki/QuickStart#prepare-the-framework <--- here in code "Mongo mongo = ....." means MongoClient ?
[20:27:55] <cheeser> the docs are just a bit outdated.
[20:34:26] <pmercado> I'm interesting in do a transparent development with mongo
[21:13:41] <pmercado> where can I found more info about query sintaxys ? fourStarHotels = ds.find(Hotel.class).field("stars").greaterThenEq(4).asList();
[21:33:22] <dgarstang> can't remember. my mind is jello after spending days trying to get this to work. someone here was going to open a doc bug for me yesterday against one of the issues
[21:33:24] <proteneer_osx> shards a really confusing
[21:42:41] <Derick> don't put two data carrying nodes (primary, secondary) on the same server
[22:05:39] <nukulb> joannac: thoughts on a good way to workaround this - https://jira.mongodb.org/browse/SERVER-1243. I can loop over the array items and update manually but I am wondering if its set to P4 then there might be exist a better work around
[22:10:13] <dgarstang> Is it possible to run addShard() on one of the shard boxes?