PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 27th of June, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:31:20] <StephenLynx> GothAlice, have you ever had problems with encoding when storing to gridfs?
[00:31:47] <StephenLynx> my special characters are coming out corrupted out of it on htmls. the same data is fine when its directly output.
[00:48:07] <StephenLynx> nvm
[00:48:13] <StephenLynx> html being retarded
[00:48:24] <StephenLynx> removed the charset from metadata and it worked
[01:16:04] <StephenLynx> hm
[01:16:16] <StephenLynx> it seems its on the process used to stream the file from mongo
[01:16:25] <StephenLynx> the file stored on mongo is alright
[01:47:07] <StephenLynx> actually
[01:47:13] <StephenLynx> the issue was with the driver.
[01:47:24] <StephenLynx> it was saving utf-8 strings with the wrong charset.
[01:47:53] <StephenLynx> I had to create a new utf8 buffer using the incoming string and write the buffer instead of the string.
[01:48:47] <StephenLynx> look at that, wt is going to be default on 3.1
[09:09:29] <lxsameer> hey guys what is the best solution to clone a document that has many references?
[09:59:52] <Lonesoldier728> Anyone use mongoose, not sure how to stop duplicates, this is not working... here is the code: http://stackoverflow.com/questions/31087413/mongoose-allowing-duplicates-with-unique-constraint-added
[11:12:53] <vagelis> Hello
[11:14:48] <vagelis> Is it possible to get some field data from one collection and then aggregate to another collection and include the field data from the first collection in the results? SOmething like combination? :S
[11:16:55] <vagelis> Example: collection A: {_id: 1, color: "red"}.............collection B: {_id: 123, collectionA_id: 1, type: jeans}
[11:17:48] <vagelis> I want firstly to get the "Red" color (which is for the jeans) and then aggregate to collection B but include the "red" somehow
[14:55:51] <greyTEO> has anyone resized their oplog? are there any gotchas to be aware of that the docs do not mention?
[15:06:12] <Siamaster> Hi, how do I get booleans from a query?
[15:06:24] <Siamaster> I've got a query:
[15:06:25] <Siamaster> db.User.find({$and:[{_id:ObjectId("558eb8bc4b7ebd27b4c6175f")}, {likes: ObjectId("558eb8bc4b7ebd27b4c61760")}] });
[15:06:30] <cheeser> you get documents from a query
[15:06:36] <Siamaster> I don't want to get the User
[15:06:50] <Siamaster> instead I want to get if the result has 1 match
[15:06:56] <Siamaster> or any match, if that's faster
[15:07:22] <cheeser> use a projection to just get the _id and then in your app check that you have at least 1 result
[15:08:46] <Siamaster> ok, but isn't that slower?
[15:09:00] <cheeser> than?
[15:09:53] <Siamaster> using the aggregation framework and unwinding the likes and then project a boolean field
[15:09:55] <Siamaster> nah just kidding
[15:09:57] <Siamaster> thanks
[15:09:58] <cheeser> in my (java) code, i'd do: collection.find(<query>).hasNext()
[15:10:21] <cheeser> well, i'd do a bit more to make sure the cursor was properly closed but still...
[15:10:24] <Siamaster> you don't use morphia?
[15:11:05] <cheeser> i maintain morphia actually :)
[15:11:40] <cheeser> but i probably wouldn't use morphia for this because I don't need all the object marshalling.
[15:13:55] <Siamaster> so using morphia would make this slwoer?
[15:13:59] <Siamaster> slower
[15:14:11] <Siamaster> wow I should think about that in my application
[15:14:17] <Siamaster> not using morphia when I don't need
[15:14:53] <Siamaster> do you get payed for maintaining morphia?
[15:14:59] <Siamaster> paid*
[16:26:49] <cheeser> Siamaster: it wouldn't make it slower, per se, it jsut does more than needed in this case.
[16:27:21] <Siamaster> then it is slower :P
[16:27:35] <Siamaster> it uses more cpu & memory
[16:27:51] <Siamaster> not visible to human eye tho
[16:28:29] <Siamaster> but could save you money in the cloud right? even if very little
[16:29:31] <cheeser> i wouldn't worry about *that*, no
[17:20:37] <Siamaster> in morphia, how can I create a query that excludes the Id but includes a single field?
[17:20:41] <Siamaster> I got java.lang.IllegalStateException: You cannot mix include and excluded fields together!
[17:21:03] <Siamaster> List<UserPicture> userPictures = mongo().createQuery(UserPicture.class).retrievedFields(true, UserPicture.IMAGE_ID).filter(UserPicture.USER_ID, id).asList();
[17:21:23] <Siamaster> that includes the _id field
[17:21:41] <Siamaster> btw, is that another think I shouldn't worry about?
[17:21:46] <Siamaster> thing*
[17:29:09] <StephenLynx> Maybe they know more in the morphia channel?
[17:31:33] <cheeser> Siamaster: if you include a field in the project everything else gets excluded except for the ID (mongodb behavior)
[17:31:50] <cheeser> it's a known shortcoming that you can't mix includes and excludes
[18:01:31] <Siamaster> @cheeser ah, you can only do that with the aggregation framework?
[18:02:16] <Siamaster> because this projection works : BasicDBObject projectCount = new BasicDBObject(PROJECT, new BasicDBObject(_ID, false).append(count, new BasicDBObject(SIZE, $ + User.LIKES)));
[21:03:36] <rusty78> a
[21:03:40] <StephenLynx> b
[21:04:07] <rusty78> heh sorry
[21:10:23] <tejasmanohar> how do i query for value: > 0?
[21:10:40] <tejasmanohar> $gt ?
[21:12:04] <StephenLynx> yes.
[21:26:38] <tejasmanohar> can i set a field as immutable in mongodb? StephenLynx
[21:26:49] <tejasmanohar> like the user field of an object
[21:27:28] <tejasmanohar> i guess i can w/ ODM https://github.com/elbuo8/mongoose-immutable
[21:44:32] <lxsameer> guys, is there anything like join for mongo db references?
[21:47:13] <StephenLynx> nope
[21:47:16] <StephenLynx> not at all.
[21:47:38] <StephenLynx> needing joins is the number one cause I recommend people mysql when I do it.
[21:47:46] <StephenLynx> relational databases*
[23:04:59] <lxsameer> hey folks. is it possible to run some bulk writes in concurrent mode?