[00:57:46] <MacWinner> freem|nd, you should be able to use dotted notation.. like schema.index({'parent.sub.field': 1})
[00:58:12] <MacWinner> haven't tried it myself, but I believe it to be true
[01:14:39] <minnesotags> I've searched, but can't find the answer. I have used "mongod -dbpath" to ensure the directory is /var/lib/mongodb. I can see that the dbpath is /var/lib/mongodb, but if I run mongod --repair, or mongod -shutdown, it still looks for the dbpath of /data/db and says it can't find the server. How do I remove this reference to /data/db?
[01:16:25] <IronMike> I'm new to MongoDB and NoSQL. I'm building a web service and want to use MongoDB as the datastore. However, I'm concerned about the consistency model for things like security tokens and such. Is this outside the scope of use cases for a db like mongo?
[03:35:34] <freem|nd> what is the best way to avoid unique key on subdocument
[08:25:27] <koren> Lonesoldier728: can you show the document you want to query? Your request seems good. Also, do you use the mongo shell directly or are you using a driver?
[08:31:43] <koren> sorry I don't know mongoose, but your query is mongodb correct, so maybe this comes from your model?
[09:05:52] <obiwahn> Derick: is there some wiredtiger related development channel or is that now all mongodb internal?
[09:14:16] <Derick> obiwahn: I don't think there ever was one
[09:14:48] <Derick> obiwahn: best bet is probably the mongodb-dev google group: https://groups.google.com/forum/#!forum/mongodb-dev
[09:17:33] <Zelest> wohoo! new laptop ordered! \o/
[09:19:54] <obiwahn> At the moment I am measuring wiredtiger against rocksdb. It seems to be a problem when the data does not fit into wiredtiger's cache. I wonder if I miss some configuration option..
[09:20:37] <Derick> obiwahn: don't think I can help you with that one - sorry.
[09:20:46] <Zelest> a 2015 years lenovo x1 carbon..
[09:22:11] <obiwahn> Does anyone happen to know if this is the "normal" behaviour? I got 300 * 10^6 key value pairs. And running over a selection of 30 * 10^6 elements takes about 6000 seconds:(
[13:48:21] <atbe> java.net.ConnectException: No route to host
[13:48:38] <atbe> Must be my network. But ServerAddress parsing is fixed!
[13:50:19] <cheeser> could be network issues, yeah. it's not far after *this* code that we're down in to jdk/netty code.
[13:57:34] <atbe> cheeser: yep, nice work. Looking forward to 3.3.0
[13:58:01] <atbe> Could I make a recommendation in regards to MongoClient instantiation?
[14:00:09] <atbe> When we began using the Mongo Java Driver, my colleague did not parse through the hosts provided to the MongoClient constructor to check if they were online in the first place (some of the host were down due to EngOps configuring things). It could be useful to instead of providing a 10000 timeout limit before raising SocketExceptions to see if the Socket is
[14:01:14] <atbe> I wrote a simple hostIsUp function that I would use to filter the potential hosts I would pass into the MongoClient constructor.
[14:01:14] <cheeser> the list of hosts is a seed list. the client will attempt to connect to the first it can find and discover the topology of your cluster.
[14:03:12] <atbe> I agree, it is a race condition but at least a warning in the logs would help so users do not produce hanging threads if they for some reason need multiple MongoClients to target different components of the cluster.
[14:03:35] <atbe> This way they can choose whether they want to create potentially unresponsive MongoClients
[15:32:39] <Karbowiak> any of you able to help me figure out where i'm going wrong with the following query: http://pastebin.com/0g9pFa6j
[15:34:05] <Karbowiak> in sql it returns a list of regionIDs, together with the amount of kills it's found - but in mongo i just get an array like: array("_id" => array("source" => regionID), "count" => 2.0)
[15:35:00] <koren> you put the sum in the group id
[15:35:11] <koren> group only by region ID and add sum in another property than id
[15:53:05] <Karbowiak> thank to the both of you tho! this really _REALLY_ helped
[15:53:19] <Karbowiak> i sort of actually understand it now.. sort of..
[16:00:54] <tantamount> How am I meant to debug, "E QUERY undefined at src/mongo/shell/assert.js:0"
[16:03:46] <braqoon> Hi I'm trying to transfer db.collection.find().sort({$natural:1}).limit(1); to pymongo syntax. Got db.collection.find(sort=('$natural', 1), limit=1) but throws me an error "too many values to unpack". Any thoughts ?
[16:19:51] <Teaboy> anyone know why createIndex() in php might not be working for me?
[16:28:43] <btorch> is there a way to make mongodb not choose a rs member's name automatically ?
[16:29:36] <btorch> like it's choosing "name" : "mongo1:27017" but instead I want to use ip or has to be somethine like mongo1.local
[16:30:13] <koren> you should put it in the hostname of the replicaset, ensure it is resolvable and you can use it when doing your rs.add
[16:30:47] <koren> but clients must use the same name, so they should also be able to resovle it
[17:42:34] <atbe> Does anyone know where I can configure syslog forwarding to a virtual ip?
[17:42:54] <atbe> https://docs.mongodb.com/manual/reference/configuration-options/ I found this but it does not specify output that is not local
[18:20:23] <kurushiyama> btorch You should read about DNS and what it means...
[18:21:30] <kurushiyama> btorch The name is supposed to be a DNS hostname, which mongo uses to resolve the IP.
[18:23:54] <kurushiyama> btorch And actually, you should never use an IP, not even an A record for replica set member addresses. Actually, the suggested way of adressing replica set members and config servers are CNAMEs. You should only deviate from this best practise unless you _really, really, really_ understand what you are doing.
[19:00:06] <theGleep> Hi, all - I have another question later ... but first; the welcome message says there's a searchable log of conversations? How do I search it?
[19:18:02] <cheeser> theGleep: you open the url with "logger" in the name
[19:31:47] <theGleep> I did ... and I got: a calendar, a list of channels, one day of conversations. I couldn't find any way to search the history. :(
[19:32:59] <cheeser> click on the day and you'll get that day's logs.
[19:34:16] <theGleep> I kinda figured that :) ... but is there a way to search across days? I'd like to see if my *real* question has been asked before I ask it again ... but it's not worth the time browsing through who-knows-how-many-days of log to find it
[19:36:13] <theGleep> So, here's my *real* question: Using Node.js and the promises version of the driver: mongo.connect(url).then(...) - what's the best way to handle closing the database?
[19:38:40] <koren> I personaly do something quite ugly but I register with the promise on my app start and add the db into global.db, then I access it everywhere using directly db., and I register a handler for sigint/sigterm to perform a db.close
[19:39:36] <koren> never heard of best practice about this, I would be interested too
[19:40:40] <theGleep> koren: I played around with that approach and bailed on it...don't remember why...I think it had to do with timeouts or disconnects or something...
[19:41:25] <theGleep> What I'm doing now is akin to the documentation (which only shows the callback approach, not the promises approach) - and has collection.db.close() buried *deep* in the callback chain.
[19:41:41] <koren> theGleep: yeah I understand. I don't handle the connection drop errors to make the service crash on purpose, then it is started again so I have not this kind of issue (a service running without connection)
[19:42:01] <koren> I read something about connection close, you should keep it open for the lifetime of the app and never close it
[19:42:24] <koren> unless your node app is running as cgi cli or something
[19:42:28] <theGleep> I *really* don't like that - the "imbalance" really bugs me
[19:42:52] <theGleep> Was that connection.close or db.close? is there a difference?
[19:43:25] <koren> I was talking about db close sorry, just talked about connection since it is actually a tcp connection
[19:44:24] <theGleep> The 3.2 docs seem to indicate the db should be closed after every call ... it looks like it's inherent in the architecture (based on the docs)
[19:46:24] <koren> they close it everytime but in a real app I think it is bad practice
[19:46:40] <theGleep> You *can* get the DB in a then-able: MongoClient.connect(url).then(function(db) {})
[19:46:45] <theGleep> but you have the same problem...
[19:47:08] <Karbowiak> hey guys, me again. I've setup a text index on a string in a collection, the names can have weird symbols, including -, when i'm doing db.getCollection('corporations').find({$text: {$search: "4M-Corp"}}) it never actually matches 100% on 4M-Corp, instead it just matches everything, any way to make it take the - into account as a part of the string?
[19:50:36] <theGleep> that's what I was thinking - but it requires a "hard-coded" regular expression. But if the regular expression works, it wouldn't be that hard to create a text equivalent and do a replacement
[19:51:58] <theGleep> Here's a wild side-idea...maybe you could include a property "words" that would be text-field.split(" ") (or a regular expression to split on any whitespace) ... then you could search for a word...
[19:52:03] <Karbowiak> the other way search for 4M and CORP
[19:53:35] <koren> hey so you had " inside the string
[19:54:16] <theGleep> interesting ... that implies that the parser *honors* an exact-term spec; but by default assumes something else.
[19:54:37] <theGleep> I'm a noob, btw, so you can ignore anything I have to say ... unless it's a good idea :)
[19:54:44] <Karbowiak> db.getCollection('corporations').find({$text: {$search: "\"4M-\""}}, {score: {$meta: "textScore"}}).sort({"$score": -1}) neat, this will do
[19:57:05] <theGleep> the only way I can really see to make the code cleaner is like you said you did, koren: create an object that keeps the database around ... but the only way to account for accidental closures is to call "getDB" which would re-connect when needed...
[19:57:30] <theGleep> (No prblem Karbowiak - makes me feel better to give back when I'm looking for help myself! :)
[19:58:51] <theGleep> ... and if I have to call getDB() anyway...the only value I'm getting is to have the "db.close()" be centralized somewhere ... and that creates the other problem of how do I fire that other somewhere? I'm not aware of any inherent "onunload" event for objects during GC...
[20:00:49] <koren> well in our services we do a db connect, add db in global and let the service crash it db is not available, so it is restarted (docker container with auto restart)
[20:00:58] <koren> so if it crash once it a while not a big deal
[20:01:07] <theGleep> with promises, it seems there *could* be something like connect(url).then(db => {}).finally(db => db.close)
[20:01:47] <theGleep> Yeah .. I am figuring that at least one of my projects will need to have "forever app.js" on it. Don't like that approach, tho
[20:02:42] <theGleep> I'm actually looking into using the Bluebird promise library, which provides the concept of a "disposer" - but I haven't figured out how that works. The docs are written from an insider's view, so I'm having trouble really understanding how to use it.
[20:03:43] <theGleep> But if there's an official way that makes more sense, I'd rather do that.
[20:06:16] <Karbowiak> daym, it seems the php driver doesn't support the $meta operator, so i can't sort by score
[20:06:47] <theGleep> Oh? I didn't know that :) :) :)
[20:14:09] <theGleep> So - for those checking in but not scrolling back; here's my question. What's the official best practice for db.close() when using the promises version of the API that's exampled here: http://mongodb.github.io/node-mongodb-native/2.1/tutorials/crud/
[21:52:41] <JFlash> ( this my personal laptop, not a production server btw. just mentioning)
[22:00:03] <theGleep> So - for those checking in but not scrolling back; here's my question. What's the official best practice for db.close() when using the promises version of the API that's exampled here: http://mongodb.github.io/node-mongodb-native/2.1/tutorials/crud/ ?
[23:32:49] <StephenLynx> theGleep, I wouldn`t use promises to begin with.