[02:14:10] <bkbonner> hi quick question about mongoclient.connect. if I'm using nodejs 12.6, docs say it should return a promise, but it seems to return undefined.
[02:14:48] <bkbonner> am I misunderstanding the docs? http://mongodb.github.io/node-mongodb-native/2.0/api/MongoClient.html
[02:19:33] <StephenLynx> I strongly suggest you update node.
[02:19:48] <StephenLynx> promises were introduced on 4.0 when they merged with io.js
[02:19:56] <StephenLynx> 12.x is really old by now
[07:01:53] <dualbus> Hey, I'm getting 404 for several current tutorials from the manual, for example: https://docs.mongodb.org/manual//tutorial/force-member-to-be-primary/
[07:02:30] <dualbus> I'm not sure if you're aware. BTW, I didn't report an issue because it requested login and it's a bother to register just to report that :-)
[08:10:30] <tamil> hi folks, is there any tool to convert old mongodb configuration file to new yaml format?
[12:10:29] <terabyte> hey. For a site that stores a wish list (assume each item has an id) for a person (who also has an id) is it better to store a single document for a user listing every item on the wishlist, or is it better to store a series of item documents which all have the userid associated with them?
[12:19:23] <symbol> That's really going to depend on your use case.
[12:20:05] <symbol> Do you want to retrieve users and wishlists together all the time? (Granted, you can use projections to not retrieve the wishlst) Do wishlists ever need to be accessed independtly from users?
[12:20:49] <symbol> If you'd ever need to access wishlists outside of users, reference it.
[12:20:51] <terabyte> a wishlist does not make sense cutting across users. So you always retrieve a wishlist for a single user, or edit an item on a wishlist for a single user.
[12:22:33] <terabyte> so i guess {user:id, items:[{item1, item2}]} makes sense over a series of {item1, user1}, {item2,user1} etc then
[12:25:35] <symbol> Although, I think some people will argue that arrays without "bounds" aren't a good idea but I don't think rule applies to small arrays
[12:25:57] <terabyte> well the list is about 3000 entries long....
[12:26:18] <symbol> One wishlist for a user has 3000 entries?
[12:26:53] <terabyte> most entries are quite small (read empty), but up to 2000 of them could have 5 'subitems' of information, a subitem of info would be about 5 fields itself
[12:32:04] <symbol> Then again - there's this article https://www.percona.com/blog/2014/02/17/dont-worry-about-embedding-large-arrays-in-your-mongodb-documents/
[12:33:00] <symbol> But that's tokumux doing some magic behind the scenes, which you could also do.
[12:36:00] <terabyte> so 3000 will be created in one go
[12:36:06] <terabyte> after that it's all subedits really
[12:37:52] <symbol> I think that should be ok. I'm curious on other people's opinions.
[12:40:59] <Pacane> Hi, I'm trying to update the mongo driver for Dart, and I'm facing a weird problem. Once I'm authenticated, I try to insert/remove records from any collection and get error messages like this one: "err: not authorized to remove from dbname.collectionName"
[12:41:05] <Pacane> My mongo instance is a free tier mongolab, and my user has the role "DbOwner" (and I tried adding read/write too but it does the same thing)
[12:41:08] <Pacane> Is there some other permission the user needs in 3.x to insert/remove records?
[12:48:45] <sousvide> probably a quick question: i have edited mongodb.conf to listen on the actual IP of the server, but "mongo" by itself still tries to connect to 127.0.0.1
[12:48:59] <sousvide> netstat -tlpn | grep mongo shows that it is indeed listening on the real ip and default port
[12:49:11] <sousvide> mongo <with the real ip> does connect, so mongo is running....
[12:49:22] <sousvide> i'm just confused why "mongo" still tries default 127.0.0.1
[13:08:52] <symbol> Oh snap. With the power of 2 allocation in 3.0 - does this mean that, if a document has to be moved, that another document can slide into the now free space?
[13:13:46] <Derick> and https://docs.mongodb.org/manual/core/storage/#power-of-2-allocation
[13:14:08] <symbol> I was on the second link, didn't know about the first.
[13:18:06] <symbol> I've been doing a bit of reading on embedding documents within arrays. Wouldn't a major downside be the reader-writer locks that happen? E.g. A blog post and comments. If comments are embedded in each post and a site has REALLY active commenters, wouldn't the read performance get hit pretty bad?
[13:19:03] <symbol> I'm thinking of the index page for all posts. While it doesn't require the comments, it'd be slowed down unless there you cached it.
[13:20:10] <Derick> symbol: yes, you're probably right. But also not really until you've benchmarked it :)
[13:20:30] <symbol> Heh, aren't there three lies? Lies, damned lies, and benchmarks?
[13:20:41] <Derick> that's why you need to make your own
[13:21:06] <symbol> That'd be interesting to benchmark/simulate.
[13:23:51] <symbol> You're right though, it's probably negliable until benchmarked. I was at a meetup where a fellow was making a fuss about the locking in versions <=2.6 and the performance hit but the speaker had used it for logging and had great write performance.
[13:39:09] <pamp> between Ubuntu 14.04 LTS and Ubuntu 14.10
[13:39:30] <pamp> which U recomended for a MongoDB server ?
[13:39:44] <Moz_> Hi All. I'm new to mongoDB but it seems great so far. I have a question - if I modify the output of the find command using a projection can I sort the objects based on a field which was excluded in the projeciton?
[13:41:02] <Derick> pamp: later software... I'd pick 15.04 (server edition, 64bit) now though!
[13:44:16] <pamp> MongoDB gives suppport for newer versions of OS?
[13:45:40] <Derick> we only provide packages for LTS, but that doesn't mean it doesn't work on later versions
[13:47:51] <the_german> How can i iterate over a whole collection with find().forEeach(...) . It is my understanding that the cursor doesn't return all results....
[13:49:18] <Derick> hmm, that should work with foreach
[13:51:13] <the_german> Derick: Ok... what could be the reason for "killcursors: found 0 of 1" in my logs?
[13:51:44] <Derick> it happens when a driver calls killcursors, but the cursors are no longer alive
[13:52:41] <the_german> Derick: That is so strange. My foreach iteration always stops between 70000 and 80000 documents. And that is the only thing I can find in the logs remotely related
[14:08:50] <the_german> no. i important a lot of jsons with mongoimport. After that I "parse" all the data and put it into another collection (this is why I use find().forEach())
[14:09:19] <the_german> I just started the process again with timeouts disabled...maybe it helps but it really messes with my head
[14:09:21] <symbol> I wonder if you have a bad doc?
[14:13:04] <hamid> Hi guys, We happen to have this problem which sometimes our embedded documents thriplicate randomly without any will, and you can see lots of repeated IDs mostly. Has anyone ever encountered this issue before (on MongoDB 2.4) and do you know if it's a known bug?
[14:14:48] <pamp> @Derick So for a production server U recommend non LTS versions of OS?
[14:15:24] <pamp> We need to make a decision now, between LTS or newer versions
[14:23:57] <schu> hi. is there a way to "import" back mongodb's .0, .1 and .ns files? i have a broken server and only access to these files...
[14:24:28] <Derick> schu: you should be able to just put them in the right dir
[14:24:33] <Derick> make sure mongod isn't started when you do so
[14:37:55] <pamp> with time I will check this better
[14:41:38] <StephenLynx> also, the better maintained repository is the RPM one.
[15:22:25] <terabyte> if you have a document as {someId:1, items:[{sublist:[{},{},{}]}]. You can always "get, update client side, post new document", is there a neat way to target the updating of elements in a that neatly?
[15:39:06] <sousvide> hi there. any ideas on why my brand new mongodb 3.0 install is completely ignoring the /etc/mongod.conf file?
[15:39:38] <sousvide> using ubuntu 14.04.3, base install, nothing else, made edits to conf file for dbpath and logpath but "sudo service mongod start" will not refer to, read, or respect the conf file
[15:40:41] <sousvide> to test, i also edited /etc/init/mongod.conf to point to my new db and log paths, same issue - running service start fails silently
[16:06:05] <morenoh149> how does mongoimport work with arrays?
[16:06:24] <morenoh149> I want to populate a document that has an array field, but I'm using csv
[16:12:38] <cheeser> does csv even support arrays?
[16:13:59] <morenoh149> it does not. After researching it looks like the only viable solution is to have a post import step.
[16:19:38] <Steve-W> Hi all. I'm encountering a problem using the sample code for the ruby driver, failing with "NoMethodError: undefined method `convert_key'" in Mongo::Options::Redacted. Others seem to have this issue, but I can't find any solutions online. Might I get a little help please?
[16:29:35] <morenoh149> you use upserts to ensure you don't insert the same data more than once right?
[16:54:43] <morenoh149> what do I do at the end of a forEach to update the current document?
[16:55:04] <morenoh149> I'm afraid db.collection.save(e) would insert the modified document again
[18:13:29] <terabyte> if you have a document as {someId:1, items:[{sublist:[{},{},{}]}]. You can always "get, update client side, post new document", is there a neat way to target the updating of individual sublist items? a sort of "update sublist where /json/path/to/sublist/id=1 set /path/to/sublist/field->1 for someId->1
[18:14:15] <terabyte> (see how it's not just an array, it's the array in an object which itself is part of an array)
[19:11:03] <morenoh149> does anyone know how to get mongo to use stringIDs like how meteor expects in a collection?
[19:11:25] <morenoh149> can I just set a setting on the collection and the database will choose the right ID type for new inserts?
[19:29:47] <morenoh149> how can I perform an update to a document that changes it's _id?
[19:30:02] <morenoh149> I'm inside a foreach and have access to a specific document
[19:46:21] <fullstack> Hello, how do I do ... findOne({someDateColumn:{$ne : { $type : 9 }}}) -- give me all rows where someDateColumn isn't type 9 -- BSON type 9 is Date