PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 12th of January, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[16:59:25] <zfigz> ahoy
[16:59:39] <zfigz> i'm playing with mongodb for the first time and struggling to get my routes in order
[17:00:29] <zfigz> getting this client side
[17:00:30] <zfigz> `Unhandled Rejection (SyntaxError): Unexpected end of JSON input`
[17:00:38] <zfigz> and this is the code that’s causing the issue, the almighty fetch request
[17:00:42] <zfigz> fetch('/songs').then((song) => song.json()).then((song) => {
[17:00:42] <zfigz> let { chords, melody, sample, _id } = song;
[17:00:42] <zfigz> console.log(_id);
[17:00:42] <zfigz> this.setState({
[17:00:42] <zfigz> _id: _id,
[17:00:43] <zfigz> sample: sample[0],
[17:00:43] <zfigz> chords: chords[0],
[17:00:44] <zfigz> melody: melody[0]
[17:00:44] <zfigz> });
[17:00:45] <zfigz> });
[17:01:00] <zfigz> i have my db hosted on mLab, but obviously something isn't right.
[17:20:45] <zfigz> so i'm able to connect to my mLab database, i just can't do a fetch request to it.
[21:57:48] <user_corrupt> I am working on an app that contains multiple chatrooms... right now I am making a collection called "chatrooms" that contains a document for each room... how should I keep track of users in rooms? Should each document have an entry like users: [userId1, userId2, userId3, ...] ?
[23:34:41] <xekz> hi
[23:34:54] <xekz> i got an index { myId, myDt }
[23:35:18] <xekz> i am running a find() with myId: 111, myDt : { $gt....$lt..}
[23:35:30] <xekz> also in find() i am specifying fields { dt: 1 }
[23:35:43] <xekz> for some reason exeecuion plan is not showing that it's doing a "covered" query
[23:35:46] <xekz> any ideas?
[23:42:35] <xekz> i think i got it
[23:42:37] <xekz> needed _id:0
[23:51:21] <xekz> but if i need _id? I can just add it to the end of the index right?
[23:51:26] <xekz> { myId, myDt, _id }