PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 22nd of August, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:04:03] <jamieshepherd> Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
[00:04:06] <jamieshepherd> Any ideas?
[00:06:48] <joannac> check the permissions on that file?
[00:52:52] <GothAlice> Hmm. I need to not just $pop the 0th element, but 0th through nth.
[00:53:31] <GothAlice> Can I reasonably bulk write the same $pop 0th operation n times? >:3
[01:00:28] <joannac> GothAlice: $slice ?
[01:02:15] <joannac> oh wait, you need to update. never mind
[01:06:35] <GothAlice> joannac: That'd work of all affected documents had the same length for this array, but they don't. Specifically, modelling a directed acyclic graph, when "detaching" a node from the graph I'd like to pop off the n ancestors identified in the target document from all descendant "ancestors" arrays. I guess I could use a $pullAll… increased transfer costs for that, though.
[01:35:55] <GothAlice> joannac: https://gist.github.com/amcgregor/651b1b106a8f73204ec7f1d8e750c637?ts=4 < what I have so far.
[01:36:39] <GothAlice> coalesce() pulls back in the ancestors arrays and calculates the path field for each, issuing another unordered bulk write. Not entirely happy with the amount of back-and-forth. :/
[01:39:21] <GothAlice> And simplified that down quite a bit. Had some old logging to remove.
[01:48:14] <GothAlice> Updated again to include the coalesce method and remove redundant modification time changes.
[04:45:48] <GothAlice> 7ms to attach a document to the root of the tree from an unattached state. Hmm. That's a bit high.
[04:46:15] <GothAlice> Consistently 7ms, though.
[04:48:08] <GothAlice> Ah, that's with subsequent document retrieval. Time to re-test.
[04:50:11] <MacWinner> do mongodb arbiters need to be powerful boxes? or can they be like aws micro instances
[04:50:33] <GothAlice> MacWinner: Arbiters only speak up during elections, and don't store data. They're very light-weight.
[04:50:46] <MacWinner> cool
[04:50:48] <MacWinner> thanks
[04:51:41] <GothAlice> 4.88ms to attach. Wewt, that's better.
[05:36:52] <naf> hello
[05:37:43] <naf> how can i append new values to an existing array entry within a document?
[05:40:04] <naf> so for example,
[05:40:09] <naf> Messages.update({_id: "2KQYXM4b7ed9Asrzz"}, { $set: { messages: [ { userId: Meteor.userId(), createdTime: new Date().getTime(), data: message } ] } });
[05:40:35] <naf> the bolded object is what i'd like to append to the messages array, in this case, rather than setting it to be exactly like that
[05:40:58] <GothAlice> First, almost no-one on IRC will see bold text.
[05:41:16] <GothAlice> Second, $push is what you're looking for. https://docs.mongodb.com/manual/reference/operator/update/push/
[05:42:18] <GothAlice> Third, is that really a creation time? Not a modification time? You can have MongoDB generate that for you, too: https://docs.mongodb.com/manual/reference/operator/update/currentDate/
[05:42:45] <GothAlice> Ah, I see why that's a creation time. ;) Still, MongoDB provides ^ to simplify things a touch.
[05:43:07] <GothAlice> naf: ^
[05:44:03] <naf> in the case that it is the way i posted it, it's a modification time, since it's updating the entry as it is...unless it's the first time. but with your help, hopefully i can make it a creation time :)
[05:44:10] <naf> i'll try working with $push
[05:44:25] <naf> thanks
[05:44:36] <GothAlice> Note that if you use ObjectIds as IDs, a creation time is included.
[05:45:18] <naf> interesting..didn't know that
[05:45:19] <GothAlice> In my forums, replies to a thread are stored in the thread, as you are doing here with messages, and I use an ObjectId for each. This lets me update those messages (if people edit their post) by ID, but, as mentioned, also includes the reply creation time in that ID.
[05:45:21] <GothAlice> :)
[05:45:46] <GothAlice> https://docs.mongodb.com/manual/reference/method/ObjectId/
[05:46:16] <naf> that's useful
[05:46:20] <naf> .getTime()
[05:46:27] <naf> .getTimestamp()*
[05:46:54] <GothAlice> Very. You can also range query them, i.e. construct "fake" ObjectIds only containing a time, and use $gt / $lt and friends to find records created after or before (respectively) that date.
[05:47:20] <GothAlice> (Only really top-level documents, though. Querying array elements suffers a few limitations.)
[05:47:49] <GothAlice> Also, sorting on these will sort by creation time. (Since the time is first in the ObjectId binary value.)
[05:47:55] <GothAlice> Very, very useful things.
[06:03:38] <naf> yeah, definitely will be sorting by creation time in this implementation
[06:31:51] <GothAlice> http://s.webcore.io/3Q18263P2o1V/Screen%20Shot%202016-08-22%20at%2002.21.47.png
[06:32:16] <GothAlice> Awww yiss. Am I missing anything for tree manipulation, in that?
[06:32:22] <GothAlice> (Manipulation or traversal.)
[06:40:20] <naf> GothAlice, is there a way i can push an array of objects using $push rather than a single element, without having them remain encased in an array when inserted into the intended document?
[06:41:15] <GothAlice> naf: Could you describe what you mean using example documents for before and what you want the result to be after?
[06:42:01] <GothAlice> https://docs.mongodb.com/manual/reference/operator/update/push/#modifiers < the documentation likely covers what you mean using $each, but I'd like to be sure. ;)
[06:42:28] <naf> sorry for being vague
[06:42:31] <naf> and thank you for the help
[06:42:36] <naf> $each is what i'm looking for
[06:42:39] <GothAlice> :)
[12:33:46] <Guest69452> can someone please help me how to update mongodb from 2.6 to 3.2 in debian jessie 8
[12:34:04] <Guest69452> i followed the docs but did not work
[12:35:30] <Guest69452> actually there seems quite a few changes from 2.6 to 3.2 i m right now strduck at user creating as the functions such as addUser are deprecated and where as createUser not working in 2.6
[12:36:28] <Guest69452> mongodb documentation provided for wheezy
[12:44:38] <cheeser> you need to step through each version
[12:44:45] <cheeser> you can't skip 3.0
[14:53:43] <ln-s> Hi, i'm trying to setup mongodb slave, however when i run "mongod --replSet rs0 --port 27017 --dbpath /home/backups/mongo-dev01 -f /etc/mongodb-dev01backup.conf --keyFile /root/key" on a fresh installation i get the following error : F CONTROL [main] Failed global initialization: BadValue: replication.replSet is not allowed when slave is specified
[14:54:40] <GothAlice> ln-s: Master-slave is a deprecated, and _not_ recommended approach.
[14:55:18] <GothAlice> If you have a replica set, omit the slave option from the config. If you actually have master-slave set up, you can't use the replSet options, and I'd recommend migrating to a more modern replica set arrangement.
[14:55:34] <GothAlice> https://docs.mongodb.com/manual/core/master-slave/
[14:55:49] <GothAlice> Master-slave is deprecated in 3.2, and will go away in the near future.
[14:56:31] <ln-s> GothAlice: okay
[14:56:49] <GothAlice> https://docs.mongodb.com/manual/core/master-slave/#convert-master-slave-to-replica-set is a handy tutorial for migrating, if that is your case. :)
[15:24:27] <ln-s> GothAlice: ok, these tutorials worked perfectly for me. In a few words it's : 1) Stop master & slave 2) Start master with --replSet 3) Set db.isMaster() on master 4) start former slave with --replSet 5) extend "master" with rs.add("<slave-ip>"). Thank you.
[15:31:00] <GothAlice> ln-s: It never hurts to help. :)
[15:51:31] <K0ki> looking for help to setup MongoDB on Windows 10
[15:51:47] <cheeser> there's an installer, no?
[15:52:39] <K0ki> yes and got done all that but in docs it says to add /data/db and not sure where for that
[15:53:38] <K0ki> I have MongoDB in Programs under C:/ is that correct ?
[15:55:56] <cheeser> in that case, you'd set you data dir to c:/data/db
[15:56:06] <cheeser> or somewhere else if you'd like
[15:57:51] <Derick> c:\data\db in the Windows case I suppose.
[15:58:31] <cheeser> windows supports /, too, fwiw
[15:58:35] <cheeser> iirc
[15:59:06] <K0ki> ? was that for me cheeser?
[16:00:00] <K0ki> This is totally all new to me so I appreciate the help from a newbie aspect ... please?
[16:00:11] <Derick> K0ki: yes, that was for you
[16:00:36] <K0ki> so can you translate Derick?
[16:00:55] <Derick> not really, I've never ran MongoDB on Windows. ... I haven't ran Windows is a decade
[16:01:19] <K0ki> sorry there are still some of us out there haha?
[16:01:30] <Derick> K0ki: I think he wanted to suggest to create the folder c:\data\db
[16:01:48] <cheeser> Derick: i just bought my first non-mac laptop in over 6 years yesterday. picking it up on the way home.
[16:01:57] <Derick> cheeser: linux or windows?
[16:02:01] <cheeser> windows
[16:02:08] <cheeser> might dual boot
[16:02:25] <cheeser> but i'll be sharing this with my kids so i need to be gentle :)
[16:02:54] <K0ki> that part I got Derick but wasn't sure of the "windows supports /, too, fwiw"
[16:03:09] <Derick> fwiw = for what it's worth
[16:03:14] <K0ki> haha
[16:03:43] <K0ki> I told you it's all new to me I just got an IRC acct about 2 wks now
[16:04:12] <Derick> different from my nearly 18 years
[16:04:41] <K0ki> cheeser so the /data/db doesn't have to be under the MongoDB file?
[16:06:27] <K0ki> haha yes! Although I've been around way longer than that not so with IRC or other things. At 67 I am making a stab at setting up my own MC server on Sponge and one of the plugins suggested Mongo. So here I am!!
[16:07:26] <Derick> now you're using words I don't understand (MC and Sponge)
[16:08:34] <cheeser> K0ki: no, it can be wherever you need it to be. mongo just needs to know where to look.
[16:08:51] <cheeser> minecraft
[16:09:01] <cheeser> Derick: ^^^
[16:09:14] <Derick> ok
[16:10:10] <K0ki> Minecraft... and Sponge is the new API? to replace bukkit and spigot
[16:10:48] <cheeser> another API?!? i despair of ever teaching my kids how to mod MC...
[16:10:56] <cheeser> K0ki: is there a url for this new stuff?
[16:13:14] <K0ki> It's supposed to be more stable and I guess bukkit and spigot are on the way out because of some legal issues and Sponge is going to be more secure for developers. www.spongepowered.org
[16:18:59] <K0ki> cheeser also #sponge on EsperNet If that's okay to say on freenode
[16:31:23] <cheeser> K0ki: danke
[16:36:57] <K0ki> cheeser YW but another question when I went to the command prompt to enter mkdir data it said there already is a data directory but in searching it doesn't seem to be what I want so I just went to the folder "MongoDB" and put another subfolder under it called data and then another folder under data called db. I feel stupid asking this question but that's the same thing right? It's been a long time since I've played around with
[16:36:58] <K0ki> dos!
[16:40:19] <K0ki> I guess I just feel intimidated by all you techie guys and gals so it automatically makes me feel like I'm doing something wrong even if I'm not.
[16:41:08] <cheeser> how are you trying to create the directory?
[16:41:57] <K0ki> at the c:\ command prompt I entered mkdir data
[16:42:40] <K0ki> but isn't that the same as putting a folder into windows with the same name?
[16:43:05] <K0ki> my mind says "of course it is!"
[16:43:45] <cheeser> and the current directory says "c:\" ?
[16:43:48] <Derick> K0ki: the same as adding a folder to the root of the C driver with the name "data", yes
[16:44:42] <K0ki> Thanks Derick I thought so
[16:44:48] <K0ki> yes
[16:44:56] <K0ki> yes cheeser
[16:48:25] <K0ki> Ok guys got it done thanks for the help and reassurance!
[16:48:42] <Derick> yay
[16:49:22] <K0ki> haha this lady thanks ya
[16:50:22] <cheeser> happy hacking!
[16:50:47] <K0ki> LOL
[17:17:26] <K0ki> Ok now here's another issue which I just thought of. IF my server is on a hosting site.. Shockbyte... is there anyway to use mongodb?
[17:17:38] <cheeser> you'd have to ask them.
[17:17:48] <cheeser> i use iniz.com, fwiw
[17:18:03] <K0ki> so that is a hosting site?
[17:18:09] <cheeser> VPS site
[17:18:17] <K0ki> VPS?
[17:18:25] <cheeser> virtual private server.
[17:18:37] <cheeser> click the host name and see. :) it's all there.
[17:19:10] <K0ki> ok thanks hope it's easy I've been down so many rabbit trails haha
[18:17:47] <n1colas> Hello
[19:00:59] <alexi5> hello everyone
[19:47:25] <Sygin> hey