[00:30:19] <timeturner> vsmatck: the thing is that I have a bunch of posts, which have one tag each, in a blog
[00:30:28] <timeturner> but the number of posts could be infinite
[00:31:11] <timeturner> so I don't know if it would be safe to store the post objectids with the tag in an embedded arrray in the main blog document
[01:32:20] <igotux> say, i have 3 hosts for setting up replica sets and if the primary goes down, secondary gets promoted as primary.. but do i ensure my application will talk to thew _new_ primary?
[02:36:06] <Ventrius> I haz question onf replication/sharding: Is it possible to have 2 local servers that have their own data
[02:36:22] <Ventrius> and then have a "master" server that stores both of their datas
[04:38:35] <igotux> can i run my production setup with replica sets and not sharding ?
[04:39:36] <igotux> say, my db will grow upto 500G of data .. hence am planning to use 3 servers , in which 2 servers are having 750G of disks and 16G of ram and one small node for arbiter
[04:39:49] <igotux> in this setp, is it ok not using sharding ?
[04:43:32] <igotux> timeturner: as you said earlier, mongos available only if i use sharding ..correct ?
[05:04:22] <igotux> mrkurt: now my data is around 50G ... 500G is the projection...
[05:05:39] <igotux> you see any smokes in this design .. because for me, sharding doesn't look simple... and needs more nodes as well..so wondering any issues if i go with just Replica Sets only
[05:08:11] <igotux> when i should go for shards.. usually what should be your data size when people consider using sharding in production environment ?
[05:08:24] <chovy> my save seemed to work in nodejs, but when I type 'show collections' in mongo console, nothing is returned.
[05:11:40] <vsmatck> igotux: It's not only a function of data size.
[05:12:49] <ron> chovy: you may have the client configured to ignore errors. I don't know node.js so I can't give you exact pointers.
[05:15:52] <chovy> i'm using mongoose. All the examples I've seen just pass an error callback to foo.save
[05:18:49] <timeturner> how many objectids do you think can be stored in an embedded array before it hits the size limit
[05:19:31] <timeturner> is there a way to calculate this
[05:22:42] <vsmatck> You could read the BSON spec or do a experiment to find out exactly how many.
[06:30:55] <igotux> so if i use only replica sets, if the primary goes down, i need to manually ask the application to connect to the new primary..correct ?
[06:31:08] <igotux> since i'm not using sharding, i can't connect to mongos..am i correct ?
[06:32:06] <timeturner> mongos is part of every mongodb setup
[06:32:10] <timeturner> regardless of sharding or not
[06:32:17] <timeturner> you neevr talk directly to mongod
[06:38:30] <igotux> timeturner: so in my 3 node replica set, apart from starting mongod process on node-1 and node-2 , do i need to start mongos process as well ?
[06:39:13] <wereHamster> igotux: you don't need mongos in a replset. Only when sharding
[06:40:01] <timeturner> you don't need to manually restart the failed primary
[06:40:09] <timeturner> it should do it automatically
[06:40:23] <timeturner> now if it fails completely, like it cannot restart
[06:40:33] <igotux> so in my use case, if the primary goes down, i need to point the application to secondary IP ( which is the current master) or change the cname in dns
[06:40:43] <timeturner> then you will need to manually fix whatever the problem is and rejoin it to the replset etc.
[06:41:40] <wereHamster> igotux: the driver should do that automatically
[06:43:23] <igotux> wereHamster: my driver will be aware of only the master ip na ?.. or is it like, we need to feed both primary and secondary IPs to driver ?
[06:43:25] <timeturner> you have to add all the replset members
[06:43:56] <wereHamster> igotux: you should give the driver more than one IP, but it will also work if you give it one
[06:44:17] <igotux> got it..ty wereHamster and timeturner
[06:44:18] <wereHamster> igotux: of course, if you give it one and that server is down while your application is trying to establish a connection to your replset, it will fail
[06:44:37] <timeturner> so be on the safe side and give it all the ips
[06:44:51] <timeturner> that way it can figure out who is the new master or who it should read from etc.
[06:44:57] <wereHamster> igotux: so you usually supply multiple addresses (does not need to be all) and the driver will discover all the nodes
[06:45:31] <igotux> wereHamster: the driver will always writes to the master ..correct..
[06:45:45] <igotux> so at any point of time, i can take down seconary for maintenance
[06:45:49] <wereHamster> yes. mongodb can only write to master
[06:46:01] <igotux> kewl...makes sense..was just confirming :-)
[06:46:27] <wereHamster> igotux: have you even read http://www.mongodb.org/display/DOCS/Replica+Set+Tutorial ?
[06:46:39] <wereHamster> or http://docs.mongodb.org/manual/core/replication/
[06:47:24] <igotux> read the almost same content from other source.. not doc.mongodb.. will chk this out as well
[06:47:56] <wereHamster> igotux: it's best to start with the official documentatino first.
[07:00:45] <timeturner> qq, is there a problem using ObjectIds for a majority of the querying?
[07:04:35] <timeturner> for example, there is a users collection in which each user has an array of objectids in which each is an objectid to a single "tag" document in the tags collection. The tag document itself doesn't have much value but the objectid of the tag document is referenced by many post documents in the posts collection. would it make sense if I were to query for all posts that have the tag field equal
[07:04:35] <timeturner> to any one of the ObjectIds stored in the user's field of an array of ObjectIds?
[10:24:29] <elricl> What happends when a mongod takes lock on a config server and then goes down?
[12:00:41] <elricl> What happends when a mongod takes lock on a config server and then goes down?
[12:14:34] <ezakimak> how do you create/save a server-side function from pymongo? I can do it from the shell, but the examples i found don't work from python: db.system_js.funcname = "function(parms) { ... }"
[12:20:44] <ezakimak> has to be a code object? can't just be a string?
[12:23:42] <mids> ezakimak: javascript code is a specific bson type
[12:23:51] <mids> but try using a string and see if it works
[13:29:20] <brahman> Hi, has anybody seen what appears to be an issue with the connection pool having stale connections. We are using version 2.0.3 in a sharded environment (aiming to upgrade) and every now and again we are getting no documents being returned but we are certain the documents exist. after restarting mongos the issue resolves itself.
[13:30:15] <brahman> I was thinking of issueing a db.flushrouterconfig to see i
[13:30:44] <brahman> any insight into this kind of problem, is much appreciated.
[14:11:08] <rydgel> Does cloneCollection() works with sharding and mongos. Can it be run inside when connected to a mongos? I've got weird assert errors.
[14:11:53] <rydgel> like this: http://pastebin.de/29666
[14:14:14] <augustl> how do I batch update a bunch of docs?
[14:21:44] <NodeX> august1 : update the same key in each records?
[14:22:27] <ezakimak> augustl, update with multi = true
[14:56:35] <Lujeni> Hi - the best order for shutdown properly an "shard" : mongoS , then mongoRS ( node , then arbiter ), then Config server ? thx
[14:56:37] <kanzie> Im trying to add a property to an existing collection using the inc-operator. If the field don't exist since before, will this be a problem?
[14:57:44] <kanzie> like I have users-collection with 100 users, but no one has the property age⦠now I want to add it if it doesn't exist (with value 1) or increment it with 1 if it does exist
[14:58:42] <NodeX> it will increment it if not exists
[14:59:55] <NodeX> db.foo.update({foo:1234},{$in:{field:1}},false,true); will add "field" = 1 if not exists or increment it by 1 if it does
[15:34:57] <Truquero> suddelny mongodb is having problems i cant start it and when i try to connect to it through an application i get this error: Could not connect to a primary node for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
[15:35:06] <Truquero> any help on this i am lost T_T
[15:35:31] <Truquero> i uninstalled an reinstalled and its the same
[15:38:14] <ppetermann> Truquero: what error does it give you when starting?
[16:10:34] <Venemo> my other question is, has anyone managed to get MongoDB working on ARM? I see there are some guys who claim to have done it, but I haven't found any code or guides on how to do it.
[16:12:00] <NodeX> I don't know about that sort of thing
[16:12:21] <Venemo> no problem, maybe someone does :)
[16:19:05] <algernon> Venemo: afaik, it works on armel, but the usual 32bit limitations apply
[16:19:32] <algernon> so it's not terribly useful.
[16:26:53] <Venemo> algernon, what's wrong with the 32 bit limitations?
[16:27:16] <algernon> Venemo: being limited to 2Gb of data sucks.
[16:27:53] <Venemo> algernon, well, I only intend to use this ARM device for testing, so I can live with that.
[16:28:31] <Venemo> algernon, the problem is that I didn't find any packages or build instructions. only a comment in a bug report from someone who claims he did it.
[16:29:15] <algernon> Venemo: if you're on armel, it shouldn't be *too* hard to compile it, I believe.
[16:29:50] <Venemo> algernon, to be specific, I'm talking about a raspberry pi.
[16:30:03] <Venemo> algernon, I'm currently running the default debian image on it
[16:34:38] <Venemo> actually ARM is bi-endian, but most of the time people use ARMEL
[16:34:51] <algernon> aye, just checked, raspbian is indeed little endian
[16:36:13] <algernon> do you get stuck at compiling at some point, or it compiles but doesn't work?
[16:37:05] <Venemo> I actually haven't tried. I just googled for it and the only thing found was an unresolved bug report. that's why I thought I'd ask here first :)
[16:37:52] <Venemo> whether it's supposed to work or not
[17:03:43] <stefankoegl> I'm trying to build mongodb from git master, and get the following error: https://friendpaste.com/55MrWtpTIufnEMRrxXbNyJ what am I doing wrong?
[17:04:22] <jmar777> quick sanity check - does a TTL collection with a second index (besides the expiry value) for username/ip/other-identifier seem like a reasonable way to keep track of failed login attempts within a certain window?
[17:04:49] <algernon> Venemo: let me know how it went :)
[17:10:44] <jgornick> hey guys, in mongo 2.2, how can i convert an ObjectID to a string?
[17:19:04] <NodeX> not sure, I can't see why it wouldn't work
[17:19:57] <xamox> Is it okay to delete all the files in /var/lib/mongo? I want a clean slate, replication and all, is it okay to blow that folder out?
[17:20:03] <jgornick> In 2.0 it was working, however, in 2.2, it doesn't seem to be converting....
[17:24:02] <jgornick> NodeX: When I do String(some object id instance) in a map function, the typeof returns "string" and the value is a string as "ObjectId("the hex")"
[17:28:52] <jgornick> NodeX: Yeah, I think the issue that was filed is wrong. They should fix the default String type conversion in 2.2 back to returning a string of the hex string.
[17:39:11] <jgornick> NodeX: I created https://jira.mongodb.org/browse/SERVER-7055
[17:55:08] <smartviking> I'm trying to add a new property to all documents, but it doesn't work:
[17:56:01] <smartviking> The second commend there returns nothing, to be clear
[17:56:09] <wladston> when I check the mongo profiler, it doesn't show info about the subset of fields I passed to my query.
[17:56:18] <wladston> as if it didn't make any difference ...
[17:56:44] <wladston> is this a problem with pymongo ? or the profiler doesn't care about the subset of queries that are requested ?
[17:57:08] <wladston> (I'm trying to optimize counting elements by only selecting the "_id" field ...
[17:59:51] <smartviking> I have a db with documents, I want to create additional functionality and need to update the old documents to hold a new value. What do I do?
[18:00:41] <smartviking> I've tried a dozen ways to add a 'popularity' field and they always fail, I feel as if some of them ought to have worked
[18:10:07] <wladston> I'm selecting a subset of fields in my query, but the mongo profiler doesn't show this information
[18:10:19] <wladston> it just shows my plain query
[18:10:24] <doubletap> ah, wladston, i am totally unfamiliar with the profiler.
[18:10:42] <wladston> I wanted to measure if the query with the subselection is faster
[18:38:53] <cmendes0101> In the aggregation framework, im attempting to do a $group but is there a way to modify the data before the $sum? Like I'm trying to replicate a GROUP BY in SQL with it retrieving another field with a CEIL()
[18:42:35] <cmendes0101> $group : { _id: "$cust_id", count: {$sum: 1},minutes: { $sum: $length}} <- To do a CEIL on $length
[18:44:15] <Neptu> hej someone that used mongodb c++ driver when i use the .connect("localhost") do I need to add all the hosts of the replica set like I do with the python driver??
[18:52:37] <Neptu> arbiter can be used as a connection host??
[18:57:42] <_m> Neptu: We are doing that exact thing here in our Rails stack.
[18:58:27] <Neptu> I read some time when i was using the python driver that was not working so thats why im asking
[19:49:46] <BrianAnthony> hey guys. receiving the error "Can't take a write lock while out of disk space" when trying to insert a record into mongodb. the collection is brand new but it does have sharding enabled with a record inserted prior for creating the index and sharding on the appropriate keys. anything fishy here?
[19:50:39] <ron> hmm.. well... do you have enough.... disk space?
[19:52:50] <BrianAnthony> asking mis... they have assured me but i'm getting a double check here
[19:53:47] <ron> Oh, I would triple check if needed/
[19:54:11] <BrianAnthony> well lucky me i'm on the dev on the project so i get to trouble shoot without access to the box because i'm not on the networking team =p
[19:56:44] <BrianAnthony> well i've been googling and it's not like "oh it's just this" it's either some crazy edge case or we're out of space and i'm being told we have space...
[19:56:49] <BrianAnthony> still waiting on the answer.. i'm worried now
[19:58:36] <ron> okay, if you need to support the database, you need access to the database machine. if you don't need to support the database, then tell whoever is supposed to do it to do it.
[19:59:13] <ron> what you describe now is the best way to make problem solving take exponentially longer.
[20:13:40] <BrianAnthony> so i am being assured 100% there is available space for folders specified in the dbpath.
[20:15:28] <ron> demand to see the output of 'df' on the server.
[20:15:30] <BrianAnthony> one thing that stuck out to us from the logs was a warning saying "warning: could have auto split on collection: my_collection.collection_name but: splitVector command failed {errmsg:"ns not found", ok: 0.0}
[20:16:25] <BrianAnthony> looking at collections and sharding status the db my_collection and the collection collection_name do indeed exist
[20:17:04] <BrianAnthony> that warning had about the same mileage in google
[20:17:48] <BrianAnthony> i'm about to just tell them to rebuild the environment since it's new anyway. something is fundamentally wrong here. i won't accept hitting an extreme edge case on the first 2 records being inserted
[20:21:29] <Neptu> hej how can i do a query with between? i want to get all the documents that are between 10 and 15
[20:21:58] <ron> Neptu: I'm tempted to tell you to RTFM.
[20:39:48] <timeturner> full text search engine recommendations?
[20:40:05] <timeturner> I looked at elasticsearch but it's written in java?
[20:40:38] <timeturner> I basically already have indexes in mongodb on what I would like to perform full text search on
[20:44:30] <_m> timeturner: We use elasticsearch and recommend it to our sister companies.
[20:45:21] <_m> You could roll your own search class if you wanted to use a purely mongo solution. We've gotten better mileage with ES than internal searching classes, so YMMV
[20:45:41] <timeturner> is it fast in your experience?
[20:45:51] <timeturner> I'm planning to use it in conjunction with node.js
[20:50:25] <_m> Pretty sure it refers to that (or something like it). Which would be an interface plugin. We don't use it here, so that's about all I can offer,
[20:51:44] <timeturner> so just to ensure I'm thinking about this correctly, elasticsearch will basically hold a duplicate of the indexes that I want to search on from mongodb correct?
[20:52:12] <timeturner> and then it uses it's algorithms to figure out which entries from the index to return based on the query I give it from the client
[20:52:29] <_m> Correct. Weighting of the indexes is configurable
[21:42:42] <Neptu> hej have a problem, im using the primary host of my replica set and if i give the driver " replica_ip, master_ip" does not do the reading, is this normal?
[21:43:05] <Neptu> should i define in order "master_ip , replica_ip" for the c++ driver i mean
[21:47:28] <pejoculant> Hi if I lose all of my config servers in a sharded set up and chunks have migrated since my last backup, am I screwed?
[21:47:46] <pejoculant> that is, do I have to do a full restore?
[23:45:57] <tomlikestorock> what's the best way to go from a MongoDate to a DateTime object in PHP?