PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Wednesday the 30th of April, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[03:43:58] <frodo_baggins> Oh boy... now I get to figure out how to include language in text search... @_@
[03:51:12] <frodo_baggins> Oh, well, it actually looks pretty easy.
[04:37:39] <k0emt> trying to get mms running on an Azure Ubuntu 12.04 instance. MongoDB is configured and accessible on the VM and from the world given appropriate CNAMES and internal/external IPs. admin db is set up with an account for mms. mms control panel has several hosts added (various attempts at CNAME and IP) along with db credentials. However, the agent doesn't seem to be reporting anything up.
[04:38:01] <k0emt> any ideas?
[07:46:44] <TheFinal> someone tried to compile objcmongodb lately on xcode?
[07:46:47] <TheFinal> having some trouble
[09:59:24] <KamZou> Hi, how fast is the removeShard command to remove (empty) chunks in a shard ? (default chunk size)
[11:12:54] <gmg85> is there a way to install mongodb driver precompiled
[11:13:02] <gmg85> on node js
[11:13:06] <gmg85> with npm
[11:21:09] <kristian_> Hello! I thing I found a JSON incompatibility bug, what should I do?
[11:43:37] <kali> kristian_: show us
[11:43:45] <kali> in pastebin
[11:45:49] <kristian_> it says mongodb BSON "conform to the JSON RFC" -- but still I "can't have . in field names". I would say this is an incompatibility
[11:47:25] <Derick> kristian_: where do you read that?
[13:24:12] <talbott> hey mongo-ers
[13:24:21] <talbott> newbie type question
[13:24:30] <talbott> but how do i allow writes into my secondary?
[13:24:54] <talbott> i have a connection from a supplier straight into my mongo (primary)
[13:25:03] <talbott> if it becomes secondary, their writes are failing
[13:25:29] <Nodex> I don;t think writes can go to secondaries
[13:26:55] <talbott> is my architecture off them? I have a primary, a secondary and an arbitur
[13:27:17] <talbott> they do a great job of failing over, but i cant tell the supplier to fail over (because they have no mechanism to take a list of hosts, only one)
[13:28:43] <Nodex> if you want HA then you need to shard and replicate
[13:28:57] <Nodex> if you want read scaling then replication will suffice
[13:29:47] <talbott> ok thanks -
[13:30:07] <talbott> do you know if there's a way to make the original primary, to back to being a primary when it comes back on line?
[13:30:13] <talbott> that would fix this up too
[13:30:20] <rustx> hi all
[13:30:34] <Nodex> I am not sure about forcing one, perhaps you can tweak the preference numbers?
[13:30:39] <rustx> i have a question about replicaset in mongo : when to mongo write collections on drives ?
[13:30:49] <Nodex> http://docs.mongodb.org/manual/tutorial/force-member-to-be-primary/
[13:30:53] <Nodex> Forst google result ;)
[13:31:01] <Nodex> first*
[13:31:23] <rustx> i have a replicaset with 3 running VMs, and my rails client retrieves document successfully
[13:31:24] <kali> talbott: you can use "priority" to force one node being primary when it's possible
[13:31:35] <rustx> but, I can't find those doing a db.collection.find()
[13:31:38] <talbott> oh great
[13:31:49] <kali> talbott: most drivers (and all official ones) accept a list of hosts for opening a connection
[13:31:58] <talbott> yeh, i've raised it with the supplier
[13:32:04] <rustx> can anyone help me to find out where are the documents stored in replicasets ? where to retrieve documents info from shell ?
[13:32:10] <rustx> any help appreciated : thanks !
[13:32:21] <talbott> so if i have server A (primary) server B (secondary)
[13:32:34] <talbott> and server A goes down, so then i just have server B (primary)
[13:32:55] <talbott> if i set server A as the priority when it comes back online, it will re-assume its status as the primary?
[13:33:56] <Nodex> rustx : what you're asking makes no sense
[13:34:17] <kali> yeah, it will catch up with B and then B will relinguish primary status, so A can take it back
[13:35:07] <talbott> that's awesome, thankyou
[13:36:23] <rustx> Nodex: sorry . may i try to explain my problem to you again ?
[13:37:40] <rustx> Nodex: i have 4 vms ( 1 ruby on rails VM as backend) and 3 Mongo VMs built on a replicaset ( 1 primary, 2 secondary)
[13:38:12] <rustx> Nodex: my ruby on rails VM can read and write documents on the replicaset, thanks to the ruby-mongo-driver
[13:38:27] <rustx> Nodex : so, from an irb shell, I can find all collections from the replicaset, and write into it
[13:39:02] <rustx> Nodex : but when i go on the primary Mongo vm, and try db.database.find(), I don't find the documents that were created by the ruby-mongo-driver
[13:40:20] <rustx> Nodex: i was wondering if the replicaset was keeping documents writing in RAM, before writing them to disk ? or, does a replicaset writes on a mongodb the same way it do it locally
[13:41:21] <rustx> Nodex: sorry if my question makes no sense .. i hope that explanation was better
[13:42:42] <rustx> Nodex: to resume , the problem i have is that i don't find the documents created by my ruby-mongo-driver on my mongo primary vm locally
[13:42:51] <rustx> is there a sync delay to write documents on disk ?
[13:45:48] <Nodex> rustx : where are you writing the docs to?
[13:45:52] <Nodex> the master?
[13:47:03] <talbott> just tested your priorty change - works brilliantly, thanks
[13:47:14] <rustx> Nodex: yep, the master ... but, maybe i found my error .. what does 'Type "it" for more' means ? on that comment ?db.routes.find(
[13:47:25] <rustx> does that means the output shows me like the first 20 records ?
[13:47:34] <Nodex> it = iterate
[13:47:40] <Nodex> i/e get more records
[13:47:54] <rustx> (facepalm)
[13:48:03] <rustx> got it, PBKC
[13:48:33] <rustx> sorry Nodex for disturbing you with that problem, which was not a mongo trouble
[13:48:41] <Nodex> no worries
[13:48:50] <rustx> Nodex: but you helped me to figure out what it was anyway, thanks a lot !
[13:49:07] <Nodex> ;)
[13:49:30] <rustx> :)
[14:43:22] <jklb> Hey smart people. Help meh http://stackoverflow.com/questions/23390768/error-setting-ttl-index-on-collection-sessions-mongodb-mongohq
[14:43:44] <jklb> Getting an Error setting TTL index on collection on my replica set at mongoHQ
[15:01:15] <miqui> not a trolling, just asking: how does mongodb fare against couchdb?
[15:02:31] <Nodex> 42
[15:02:41] <Nodex> and that's not trolling either
[15:03:52] <cheeser> different use cases so comparing them isn't exactly ... useful
[15:50:07] <smartatt1ck> Is there any dependency between Mongo shell and server versions?
[15:50:32] <smartatt1ck> ie: if we run server 2.4.8 - can we connect to it with mongo client/shell 2.6.x ? any caveats?
[15:52:34] <q85> By shell do you mean mongos?
[15:52:58] <Nodex> mongos is not a shell
[15:53:16] <Nodex> it's a shard
[15:53:22] <Nodex> http://docs.mongodb.org/manual/reference/program/mongos/
[16:20:13] <q85> my understanding is that mongos is how you access shards. however, mongos is not a shard, it doesn't store sharded data. am I wrong?
[16:36:21] <svennidal> is there anyone here that has experience setting up MongoDB on a PowerPC?
[16:38:23] <svennidal> http://pastebin.com/PFGBxLmL
[17:09:31] <mcr> Can I run a mongos on multiple systems? I want to migrate where it runs from being at HQ, to being in a cloud, but I don't want to interrupt all the applications talking to it
[17:11:00] <mcr> I think that I can, and I also think that having multiple mongos running is not unusual.
[17:12:45] <cheeser> more than one on a single machine is rather pointless, yes.
[17:28:06] <skot> svennidal: no ppc support
[17:29:10] <skot> (for the server, but you should be able to compile/use any client like c++/c/java/python/node.js/etc)
[17:36:54] <moleWork> in node.js what is prefered: var mongoClient = new MongoClient(new Server('localhost', 27017)); mongoClient.open()........ or MongoClient.connect("mongodb://url....
[17:37:32] <LouisT> moleWork: i would assume it's what you prefer
[17:38:30] <moleWork> i'm trying to tell if there are differences... like one has maxPoolSize and one has poolSize... not sureif they differ in behavior or not yet... poolSize creates all the connections and doesn't scale on demand... not sure if .connect with maxpoolsize has different behavior
[17:38:42] <moleWork> also i'm trying to figure out how to deal with driver state
[17:39:35] <moleWork> like using .open.... is it if(mongoClient._db.state != "connected") { i can't use you right now)
[17:40:32] <moleWork> trying to figure out what the differences are right now
[17:40:58] <moleWork> trying to avoid "Connection was destroyed by application" errors
[17:48:28] <moleWork> also seems weird you can specify connectTimeoutMS and socketTimeoutMS in url and in options hash (along with maxPoolsize in url and poolSize in optionshash)
[18:09:55] <moleWork> looks like maxPoolSize is same as poolSize just weird naming,.. maxPoolSize isn't the maximumPoolSize, it is the poolSize so if you specify it, it opens that many connections right away, it doesn't scale up,... which is same as what poolSize does
[18:17:45] <q85> mcr, yes, you can have multiple mongos instances, on different hosts, connected to the one cluster. You can also have multiple mongos instances, on the same host, each connected to a different cluster.
[18:18:11] <mcr> q85, thanks for confirming.
[19:05:58] <mt79qx> Can someone help me with a replica set question?
[19:13:31] <kali> mt79qx: skip the metaquestion, ask the real question (rule #0 of irc etiquette)
[20:45:25] <frodo_baggins> is it not possible to use $exists for sub-documents?
[20:46:19] <cheeser> $exists takes a field name...
[20:47:37] <frodo_baggins> Strange. That's not what the documentation says. :D
[20:48:08] <frodo_baggins> Your suggestion worked though, so thanks. :D
[20:49:59] <q85> Syntax: { field: { $exists: <boolean> } } http://docs.mongodb.org/manual/reference/operator/query/exists/
[20:50:57] <frodo_baggins> Yeah, I tried it that way and it didn't work.
[20:51:08] <ranman> frodo_baggins: can you post your query?
[20:51:42] <ranman> frodo_baggins: and sorry I'm just joining in so could you also state: version of database, shell or driver language and version
[20:52:01] <frodo_baggins> I'm using version 2.6.0.
[20:52:21] <frodo_baggins> Driver language and version is Node.JS v0.10.26.
[20:52:31] <ranman> node-mongodb-native driver?
[20:52:44] <ranman> https://github.com/mongodb/node-mongodb-native ?
[20:52:48] <frodo_baggins> Underneath, yes, but mongoskin on top of that.
[20:54:49] <ranman> frodo_baggins: so for me something like this works with embedded documents: db.lots.find({'lots.outs.date': {$exists: true}})
[20:55:10] <ranman> without seeing your query and an example doc I doubt we could further diagnose sorry!
[20:55:46] <frodo_baggins> okay, here's my query: {entry: "something", language: "english", translations: {german: {$exists: true}}}
[20:59:27] <ranman> frodo_baggins: change to this: db.test.find({
[20:59:27] <ranman> entry: "something",
[20:59:27] <ranman> language: "english",
[20:59:27] <ranman> 'translations.german': {$exists: true}
[20:59:28] <ranman> })
[21:00:06] <grails> hello I have a question, anybody could help me please?
[21:00:14] <ranman> what's your question?
[21:00:42] <grails> I have a collection with documents with special chars (spanish characters)
[21:01:13] <frodo_baggins> Ah, that works.
[21:01:14] <grails> and when I try to found any of these not found
[21:01:32] <grails> example
[21:01:42] <grails> "_id" : 15101, "_cls" : "Poblacion", "provincia" : 46, "descripcion" : "Alcúdia", "codigo_municipal" : "0193" }
[21:01:43] <ranman> grails: can you post an example query and document in a gist or pastebin?
[21:02:04] <grails> and I try to find with mongoengine in python
[21:02:22] <grails> provincias = Provincia.objects(descripcion__istartswith='alcudia');
[21:02:37] <grails> and no return results
[21:02:43] <grails> sorry for my english
[21:03:37] <ranman> grails: 1) put a u in front of the string 'alcudia' and make sure you're using the accented character like this u'alcúdia' and also pass in the ignore case option
[21:04:51] <ranman> frodo_baggins: sweet glad that works!
[21:05:04] <grails> oks
[21:05:49] <grails> not, doest not work :(
[21:06:00] <ranman> grails: even with ignore case?
[21:07:04] <grails> in the mongoengine documentation: "istartswith – string field starts with value (case insensitive)"
[21:08:26] <grails> mongodb stores the document ok, but I cant find without "ú" char
[21:10:35] <grails> db.poblacion.find({"descripcion": { $regex: /\balcudia/i}}) works!
[21:15:03] <ranman> grails: I'm able to search and this returns: db.test.find({'descripcion': 'Alcúdia'})
[21:15:28] <ranman> grails: also this: db.test.find({'descripcion': {$regex: /alcúdia/i}})
[21:15:54] <ranman> What I might suggest if you need to support a lot of this is enabling a full text search field for spanish
[21:16:44] <ranman> grails: http://docs.mongodb.org/manual/administration/indexes-text/
[21:17:21] <grails> but fulltextsearch index does not increase the database size too much?
[21:19:53] <ranman> grails: it probably will yes
[21:20:32] <ranman> grails: your other option is to enumerate the set of accents that are possible in spanish and create a search function that creates a regex that matches all those special characters
[21:20:55] <ranman> grails: or you can pass on to your users that they have to type the special characters :D
[21:21:01] <grails> hehehe
[21:21:12] <grails> last option is not possible...
[21:21:47] <grails> in spanish are very important the special chars like ñáéíúó, etc
[21:22:14] <arrty> it seems like mongodb has better support than rethinkdb for sets, arrays, and unique indexes
[21:22:21] <ranman> arrty: yes.
[21:22:53] <ranman> ok so you can, for the fields that may contain special characters, create a regex [ñn] etc
[21:23:00] <ranman> or just use a full text search index
[21:23:46] <ranman> grails: you can alternatively create YET another field called searchDescripcion
[21:23:48] <ranman> or something
[21:23:57] <ranman> and use plaintext for that
[21:24:29] <grails> the problem right now is not mongodb because if I search with a regex found the records, but mongoengine not support natural regex
[21:27:32] <ranman> grails: you can do a raw query
[21:28:11] <ranman> Provincia.objects(__raw__={'descripcion': {$regex: /alcúdia/i}});
[21:31:39] <grails> I'm looking at right now
[21:31:50] <grails> thank you ranman for your help!
[21:31:58] <ranman> NP, good luck!
[21:53:37] <TheFinal> please help, i need an xcode project to be able to compile the c++ driver to be used in a ios app…
[21:54:56] <ranman> TheFinal: why do you want to give an iOS project direct access to your database? that's wrong.
[21:55:20] <TheFinal> why?
[21:56:07] <TheFinal> if i use a encrypted connection to mongodb port..
[21:56:54] <ranman> TheFinal: security mostly, also it's inefficient, what exactly are you trying to do with your iOS app? Have you considered just using a backend like parse instead?
[21:57:21] <frodo_baggins> Does MongoDB have any conventions for the naming of document properties?
[21:57:30] <frodo_baggins> Such as... a_property_name, or aPropertyName?
[21:58:05] <TheFinal> what i’m trying to do is a prototype, needs to be a quick one, to a sort of a “social” app based on user coordinates. now i need to realize a proof of concept
[21:58:24] <ranman> TheFinal: use parse, putting a database driver in the iOS app is incorrect.
[21:58:31] <ranman> TheFinal: or write a backend
[21:58:38] <frodo_baggins> It seems MongoDB prefers underscores over camel case.
[21:58:45] <frodo_baggins> From looking at the documentation.
[21:58:47] <ranman> frodo_baggins: for larger datasets prefer shorter field names, otherwise it's up to you
[21:58:59] <ranman> frodo_baggins: no there's no particular style recommened
[21:59:16] <ranman> frodo_baggins: if you're primarily working in JS I would prefer camelcase to stick with those conventions
[21:59:33] <frodo_baggins> Ah, that is what I'm using.
[22:02:03] <TheFinal> ranman: you mean https://www.parse.com? (sorry really a noob about mongodb)
[22:23:57] <grails> ranman: Provincia.objects(__raw__={'descripcion': {'$regex': '/alcúdia/i'}}) doesn't work :(
[22:26:09] <grails> mongoengine executes: {'descripcion': {'$regex': '/alcúdia/i'}} like string not like an regex
[22:26:12] <grails> a* regex
[22:36:27] <ranman> grails: {'$regex': 'alcúdia', '$options': 'i'}}
[22:36:29] <ranman> should works
[22:44:43] <grails> ranman: yes, but I would like find {'$regex': /alcudia/, '$options': 'i'}} but mongoengine converts /alcudia/ to '/alcudia/'
[22:45:16] <ranman> grails: / and / are just the escape portion, you don't need those with the regex flag, it's already a regex
[22:45:24] <ranman> grails: the regex ends when you close the string
[22:45:45] <ranman> http://docs.mongodb.org/manual/reference/operator/query/regex/
[23:11:26] <frodo_baggins> Hmm, it looks like my upsert isn't quite working as I had hoped.
[23:26:15] <frodo_baggins> Does an update query have to have all the fields in order to match an existing document?
[23:27:36] <ranman> frodo_baggins: fields no? array elements yes
[23:27:47] <ranman> frodo_baggins: as always :), example you want to match and query you're using?
[23:28:05] <frodo_baggins> Ah, that may be my issue then, the document I'm hoping will be matched has array elements.
[23:29:47] <frodo_baggins> Which, in my case aren't exactly necessary.
[23:29:59] <ranman> you can use $in query to match just some array elements
[23:40:45] <frodo_baggins> What I want to do basically is check for two fields, increment another field, while using the upsert option.
[23:41:02] <frodo_baggins> And have it match a document that has many other fields.
[23:41:32] <frodo_baggins> Here's a code sample: https://gist.github.com/blafreniere/b16b78dc9824e35771f8
[23:45:14] <ezrios> so I'm using mongoengine for Python and I'm not sure I understand the difference between the `unique` and `unique_with` constraints
[23:45:41] <ezrios> well actually I just don't really know what `unique_with` means
[23:46:02] <ezrios> does it mean that a particular combination of the fields given is unique?
[23:47:56] <kireevco> Hi all, does anyone use puppet to orchestrate mongodb cluster configuration? Thanks!
[23:54:09] <moleWork> damn... anyone run mongodb on azure before
[23:54:13] <frodo_baggins> Perhaps this is what I need? http://docs.mongodb.org/manual/reference/operator/update/setOnInsert/
[23:54:47] <moleWork> i've been playing with keepalive's and everything.... to try to make this connection pool stable but alll of a sudden i get "end connection" and it shuts down the whole connection pool and starts it up again
[23:55:01] <moleWork> this desk is getting flipped