[07:59:55] <spicewiesel> please, what's the best way to copy the data from on sharded setup (mongos+cfgsrv+replicaset) to a similar test environment? (same setup)
[08:45:32] <Seraf> hello everyone. I have a replicaset. All nodes are stuck in STARTUP2 mode ... I know which one should be the primary, how can I force it please ?
[08:45:48] <Seraf> (can't play with data and conf, it's in production :s )
[09:10:35] <liviud> I have several nodes with 2.2.0 mongodb. If I upgrade some to 2.4 and use the 2.4 drivers in a replicaset configuration will the 2.4 drivers be able to talk to the 2.2.0 mongodbs ?
[09:16:09] <kali> liviud: check out the release notes for 2.4. IIRC, there is something to do if you're using sharding or it will break, but replica set are fine. keep in mind it is better to migrate all nodes ASAP, partially migrated state is not meant to last long
[09:20:03] <Seraf> hello everyone. I have a replicaset. All nodes are stuck in STARTUP2 mode ... I know which one should be the primary, how can I force it please ?
[09:33:52] <kali> Seraf: is it a brand new replicaset ?
[09:42:40] <liviud> kali: yeah, that temporary setup is part of the migration movement
[09:42:49] <liviud> we still need it to be up while migrating it
[09:44:28] <kali> liviud: yeah, it's up and running. and there are no known problem with it.
[09:44:47] <liviud> also we seem to encounter a problem with a custom php app that's using the 1.4.3 driver
[09:45:31] <liviud> in the replicaset environment, if one of the nodes times out ( for example by lack of connectivity ) the driver seems to get stuck in the connected state for a large while...
[09:46:37] <liviud> which, although we used the default timeouts code-wise, it should be by default less than half a day I suppose :)
[09:47:20] <liviud> on the other hand if the node goes down ( kill -9 mongodb or stop it ) everything runs just fine
[10:29:33] <spicewiesel> is there a way to reset the local admin pw in a replicaSet?
[14:54:32] <Industrial> Hi. I have a user collection for my webapp and I have a complete authentication setup now, however the authorization is limited to 'are you logged in or not'. How do I authorize users to perform requests/actions in my webapp based on a structure/collection in mongodb? Anyone done this before?
[14:55:14] <Industrial> I want to be able to specify that users can view all profiles but only edit their own profile, and a moderator or admin could do everything
[15:06:50] <Industrial> I guess for now a role enum/string will do.
[15:10:57] <Nodex> Industrial : I do that with an array of users / groups and interset the current user to it
[15:18:21] <edugonch> Hello, I'm having some problems with rails 4 and mongoid, I'm getting this errors http://pastebin.com/8RaaSMDH
[15:18:39] <edugonch> this is my yaml file for mongoid http://pastebin.com/gpLBZZ6G
[15:19:21] <edugonch> this is new, I was able to run my app without this error some days before
[15:21:35] <Nodex> doesn't look like a mongo error to me
[15:27:15] <edugonch> when I ping 127.0.0.1:27017 I get unknown host 127.0.0.1:27017
[15:27:28] <edugonch> so I can't access the server also without rails
[16:37:02] <adamcom> correct - because the drop removes the actual files
[16:37:17] <adamcom> the remove leaves the files in place, deletes the data in them
[16:38:00] <adamcom> if you removed everything then did a db.repairDatabase() that would reclaim the space too, but the drop is going to be a lot quicker
[17:35:14] <insanidade> hi all. I'm using a script to restart and connect to mongodb but I have the following issue: the service restart output reports that mongodb was correctly restarted but any attempt to connect to it results in an output as if mongodb is down.
[18:12:58] <quickdry21> How can I convert a replica set to a standalone in the config DB? I'm trying to test backups but don't want to have to deploy an entire replica set for each shard.
[18:14:00] <quickdry21> Possibly as easy as doing a config.shards.update()?
[18:28:51] <quickdry21> To answer my own question, yes, you can do a config.shards.update({_id: 'rs*': 'new-host:port'}) for each shard to convert it to a standalone and change the hostname all at once, then copy the configdb path to all three config servers
[18:37:07] <sflint> anyone here good with aggregation
[18:37:12] <sflint> this is a pretty easy question
[19:10:44] <cheeser> really? you're going to have portuguese and english in one sentence?
[19:11:27] <a|3x> no, i would have {'english_page': '...','portuguese_page':'....'}
[19:12:01] <cheeser> oh, i see. i'd break those up in to different documents personally
[19:12:30] <a|3x> ya but thats just an example, there could be other usages
[19:12:41] <cheeser> i don't think that's supported.
[19:13:24] <a|3x> also, another problem is what i have actually, i am using 'language' for something else, i was debugging a problem with text search for hours until i found that my own language field is breaking things
[19:13:46] <a|3x> this is no a very good idea to decide to use 'language'
[19:27:01] <cirwin> Is there any reason to use config passed in as a hash instead of in the URL? I'm using the mongoskin node driver to connect to a mongos and want to specify readPreference=secondaryPreferred
[19:27:17] <cirwin> it seems like just putting in the URL shoudl work, but I'm not sure how to test it
[19:50:29] <qswz> is it possible to do injections in mongo (like sql injections)?
[19:51:47] <bjori> qswz: if you don't filter your input then nothing is safe
[19:52:09] <bjori> qswz: for example, if the user input is used to structure your fieldnames and criterias then you are in big troubles
[19:52:46] <bjori> same with values. if the user changes the input to an array, then he can create a complex query that does totally different things then you wanted
[19:53:20] <bjori> so if you are doing fieldname $eq user-input, you better be suer user-input is a scalar value, not array
[19:53:29] <qswz> for that I'll put an authentication layer
[19:53:33] <bjori> depends on your language how exactly this is structuresd
[19:55:16] <qswz> I'm mapping ajax request in json, more or less directly to mongo's requests, even the collection [collectionName, 'find' or 'update'.., json, orther json]
[19:56:21] <qswz> [collName, accessToken, <- forgot it
[19:58:08] <qswz> then there is access right on documents, with hard-coded _canRead, _canUpdate fields, to restrict documents to a group
[20:01:57] <bjori> please don't use a user defined variable for picking operation or collection name
[20:13:42] <qswz> If I create a json with a valid token, I'm able to put _canUpert in the document coainting my email and others, and only those can upsert it, same goes for delete
[20:14:02] <qswz> I was just scared about hacky things
[20:14:55] <qswz> and to look stupid if that thing isn't safe
[20:22:50] <qswz> the db won't have passwords (openid auth)
[20:27:35] <qswz> just restricting collectionsnames, and it's 'safe' ?
[20:35:44] <qswz> yeah, because , I was ableto read system.users :))
[20:36:21] <qswz> now usale colllections are prefixed
[20:55:22] <qswz> http://jsbin.com/UNIxosA/3/edit more complete example
[21:53:10] <travisgriggs> i'm changing my document schema, changing to custom _id's. Is there a way to find() all docs that have an _id of type ObjectID? Or another technique to remove all of them?
[22:27:01] <travisgriggs> i just learned that remove() actually does a match, you don't just have to feed it one complete document at a time. i seriously love mongo
[22:44:18] <travisgriggs> having just switched one of my doc fields to be the _id... I find myself missing the more descriptive name. I wish there was a way at collection creation time to indicate an alternate name for the sacred/special _id field
[22:47:06] <retran> it's just one more stupid thing to familiarize myself with in a schema that has nothing to do with business logic
[22:48:01] <iwantoski> When I'm updating a document, it removes any field that isn't present in the update - why is that? Much I get the full object in order to preserv its completness
[22:54:52] <jjbean> I think you might be right about the geoWithin query feature in my case, but thought I would check here as i'm running out of ideas at the moment
[22:54:59] <travisgriggs> consistency is nice. it seems like you just trade "just one more stupid thing to familiarize myself with in a schema that has nothing to do with business logic" from one to the other
[22:55:35] <travisgriggs> you never have to worry about figuring out what the special/sacred field is. it's always the same. otoh, any time it's custom, you have to figure out what it actually is
[22:55:45] <iwantoski> Joeskyyy: Oh wow, I missed that .. I've been look at that page for a while now :/
[22:55:56] <Joeskyyy> It's kinda hidden, one of the gotchas of mongo
[22:56:02] <travisgriggs> any code you write around it, you have to figure out "so what are they using _id for here?"
[22:56:05] <Joeskyyy> When you THINK update, you think it would update the field you give it haha
[22:56:25] <Joeskyyy> But ultimately it makes sense to update by changing the document by default, then using $set in all other cases.
[22:56:54] <travisgriggs> so i offer my second wish, slightly more educated now :) i wish there were a way to have field aliases. Then you could have _id always be there. but one could alias it where appropriate
[22:57:55] <iwantoski> Joeskyyy: Yea sure, I'm not one to critize that solution because I'm new to both mongodb and nosql/non-relational dbs in general - I'm coming from a traditional setting with relational dbs :)
[22:58:08] <Joeskyyy> Welcome to the better side :D
[22:59:54] <iwantoski> Hm, "while I have you one the line", I have a different question I havne't had time to test yet. regarding 2d Indexes, which I've only read about - but they seem to be sub-optimal when latency is of importance, any thoughts/input regarding this?
[23:00:10] <retran> it's easy to know what they are using _id for in Mongo
[23:02:30] <iwantoski> retran: The impression I've got is that it's not as fast as - say postgresql's implementation
[23:03:10] <retran> how many things are better than postgres
[23:03:12] <iwantoski> (i'm going to do this using mongo for now anyway to try it out, but I just thought I could get some feedback on the matter)
[23:04:28] <iwantoski> I'm not trying to call out a db war, I'm just asking - because for what I'm building, I'm really concerned about low latency lookup from (2d) geospatial data which is high concurrent.
[23:04:34] <travisgriggs> so you see one of my documents {'_id': 'F00008', 'last_update': <datetime>, 'ip_address': '10.20.30.40'}, and you know what I'm using for my PK retran?