PMXBOT Log file Viewer

Help | Karma | Search:

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

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:38:51] <hahuang65> what's the hotline to call in emergencies?
[00:40:29] <StephenLynx> 911 i guess
[00:46:13] <Boomtime> hahuang65: if you have a support contract the phone numbers are shown on the /CS jira page
[00:46:21] <hahuang65> Boomtime: thanks, found it.
[10:46:28] <MidasVO> Hey everyone I have a silly question maybe someone can clarify something for me... How would I
[10:51:33] <MidasVO> testSet: { request: { type: Object}, test: { type: Object} },
[10:51:53] <MidasVO> Is that the proper way to define an array? Can I add multiple tests to that testset?
[10:52:24] <MidasVO> or should it be one deeper? like testSet -> test -> assertion, request
[10:52:41] <MidasVO> jeez why did i call assertions tests -.-
[10:55:17] <MidasVO> https://gist.github.com/midasvo/d81053d8f628d0d850ab#file-gistfile1-txt
[10:55:41] <MidasVO> I have it like that, is it logical that I can now create testSets
[10:56:29] <MidasVO> ugh really hard to describe what i mean but.. this model can have more than 1 test in it right? or do i need to do something special to make that possible?
[10:58:17] <MidasVO> or should i just make a new model called testSet and reference it?
[10:58:25] <MidasVO> jeez this is hard
[11:32:53] <the_voice_> Hi
[11:33:35] <the_voice_> I am now in my second week of mongo and I am coming from a mysql background
[11:34:59] <the_voice_> I have to say it is quiet the change.
[11:36:47] <the_voice_> One thing I am trying to understand is when is it best to embed documents or to use a reference
[11:38:13] <the_voice_> Anyone have some good reading material about the topic?
[17:11:43] <Lonesoldier728> hey not sure why this mongo error pops up ... http://pastebin.com/cesfPFRt am I querying that incorrectly some how?
[17:12:22] <Lonesoldier728> I am using mongoose, and the two ids are string values not sure if htat is a problem too
[17:13:29] <StephenLynx> the inc is outside the update block.
[17:13:34] <StephenLynx> aside from that
[17:13:37] <StephenLynx> mongoose is awful.
[17:13:45] <StephenLynx> and slow.
[17:13:54] <Lonesoldier728> How is it outside, it is within the same one as addToSet
[17:14:06] <StephenLynx> aah, yeah
[17:14:07] <StephenLynx> :v
[17:14:17] <StephenLynx> >findByIdAndUpdate
[17:14:18] <StephenLynx> what
[17:14:23] <StephenLynx> is that a mongoose thing?
[17:14:26] <Lonesoldier728> yeah
[17:14:29] <StephenLynx> lol
[17:14:36] <StephenLynx> seriously, I suggest stop using it.
[17:14:51] <Lonesoldier728> what would you use in its place or straight mongo
[17:15:09] <StephenLynx> straight mongo.
[17:15:26] <StephenLynx> the official node driver has a pretty good documentation and is supported by 10gen
[17:15:44] <Lonesoldier728> mongoose is also preached by 10gen if I remember correctly
[17:15:52] <StephenLynx> except it sucks.
[17:15:59] <StephenLynx> its about 600% slower.
[17:16:12] <StephenLynx> and shits itself with ids.
[17:16:24] <Lonesoldier728> well it is something that can be dealt with in the future... for now I need to figure out why this is not working : /
[17:16:40] <StephenLynx> mongoose is fucking up.
[17:16:45] <StephenLynx> that is why is not working.
[17:16:48] <StephenLynx> the query seems fine.
[17:17:06] <Lonesoldier728> well let me elaborate the fields maybe I am missing something
[17:17:33] <StephenLynx> but one thing
[17:17:47] <StephenLynx> it seems the block you are using for update its used for projection
[17:17:57] <Lonesoldier728> http://pastebin.com/ASsMcKFx
[17:17:59] <StephenLynx> "BadValue Unsupported projection option"
[17:18:02] <StephenLynx> "projection"
[17:18:21] <greyTEO> StephenLynx, Yea i think the param options are in the wrong order
[17:18:23] <Lonesoldier728> which block? the findByIdAndUpdate
[17:19:56] <StephenLynx> no idea
[17:20:11] <StephenLynx> I have never seen something like that in the regular driver or the terminal.
[17:20:21] <StephenLynx> the projection block usually is passed in the options object.
[17:20:32] <StephenLynx> for a find and modify operation
[17:20:42] <greyTEO> http://mongoosejs.com/docs/api.html#model_Model.findOneAndUpdate
[17:22:39] <kba> if I have a collection with an array in it, how would I find a specific value in the array and remove it?
[17:23:42] <kba> $pull, nvm
[17:25:10] <kba> hm, but that and doing .save isn't atomic in mongoosejs
[17:25:42] <kba> if I do collectionInstance.arr.pull(id); collectionInstace.save(), that won't be atomic, I assume
[17:25:54] <kba> so an id from arr could get pulled twice?
[17:26:49] <StephenLynx> stop using mongoose, kba
[17:26:58] <kba> why, StephenLynx?
[17:27:45] <StephenLynx> because its slow, uses non-standard ways to deal with ids
[17:28:02] <StephenLynx> everyone that comes here with issues using node/io its because its using mongoose.
[17:28:07] <StephenLynx> I am not kidding you
[17:28:08] <kba> do you have any source on it being slow?
[17:28:21] <kba> would pull be atomic withuot mongooes?
[17:28:34] <Lonesoldier728> wow i think you were right mongoose just messed up but i did change from _id: id to just id
[17:28:43] <StephenLynx> http://codeandcodes.com/tag/mongoose-vs-mongodb-native/
[17:29:01] <StephenLynx> mongoose is the single worst ODM out there.
[17:41:13] <kba> is there any other ODM that allows me to define schemas and validation rules?
[17:41:21] <kba> because that's the selling point for me
[17:44:07] <StephenLynx> you might want to use a relational database then.
[17:44:09] <StephenLynx> if that matters so much.
[17:44:19] <StephenLynx> the selling point of mongo is just not having these.
[17:44:47] <StephenLynx> among other things
[17:46:43] <StephenLynx> since mongo doesn't have relational integrity, I cannot see the point of schemas and validation rules.
[17:46:53] <StephenLynx> you just have one big overhead for nothing.
[18:55:29] <shlant> does the root role have all permissions on all db's? I ask because I am using a root user to access my db from my node app, but it seems that some content isn't loading which makes me think it's permissions
[18:56:06] <StephenLynx> afaik the system's users have no relation to the database permissions
[18:56:13] <StephenLynx> ah
[18:56:13] <StephenLynx> wait
[18:56:43] <kba> StephenLynx: the idea is that the schema is more advanced than just tables
[18:57:11] <StephenLynx> kba that makes absolutely no sense.
[18:57:25] <StephenLynx> and shlant sorry, I didn't know there was a role called "root" :v
[18:58:31] <StephenLynx> it doesn't matter how advanced a tool is, if you don't need it, its just a waste of resources.
[18:58:32] <kba> StephenLynx: it makes no sense to have schemas more complicated than rows of data? Yes, sure, it could be done with 5 table instead of one collection.
[18:58:44] <kba> StephenLynx: in that case, anything could be stored with
[18:58:50] <kba> a RDBMS
[18:59:01] <StephenLynx> but
[18:59:07] <StephenLynx> anything can be stored with a relational db.
[18:59:11] <kba> Exactly.
[18:59:14] <kba> That's what I just said
[18:59:18] <StephenLynx> and I just suggested you to use one if you really need schemas.
[18:59:32] <kba> Pretty much everything needs schemas.
[18:59:36] <StephenLynx> no.
[18:59:40] <StephenLynx> that is false.
[18:59:49] <StephenLynx> that is why mongo doesn't enforce schemas.
[18:59:53] <StephenLynx> because sometimes you don't need them.
[19:00:00] <kba> I didn't say always.
[19:00:23] <greyTEO> i think kba wants structure for the data, not a schema?
[19:00:46] <kba> Indeed. Maybe we don't share the same definition of a schema
[19:01:18] <StephenLynx> what keeps him to structure his data?
[19:01:25] <StephenLynx> you don't need a schema for that.
[19:01:33] <StephenLynx> him from*
[19:01:42] <kba> With that logic, you never need a schema.
[19:01:45] <StephenLynx> no
[19:01:49] <StephenLynx> sometimes you need a schema
[19:01:53] <kba> Why?
[19:01:58] <StephenLynx> because you need relational integrity.
[19:02:09] <StephenLynx> that is why relational databases have them.
[19:02:14] <kba> As long as something has an id, you can refer to it
[19:02:27] <StephenLynx> yes, but sometimes you want to be sure the relation is valid.
[19:02:33] <kba> Oh you do, really?
[19:02:41] <kba> And sometimes you want to make sure your data adheres to a structure
[19:02:45] <kba> So that's why I want a schema
[19:02:52] <StephenLynx> so thats why you need a relational database.
[19:02:53] <kba> You don't seem to have a point other than disagreeing with everything I say.
[19:03:10] <kba> So whenever you want to make sure a relation is valid, you also need a relational database with that logic.
[19:03:17] <StephenLynx> yes.
[19:03:36] <StephenLynx> or a database that implements relational integrity at least.
[19:03:37] <kba> So all NoSQL databases with relations are wrong.
[19:03:46] <kba> That's what you're saying
[19:03:48] <StephenLynx> no
[19:03:52] <StephenLynx> stop playing dumb.
[19:03:55] <StephenLynx> what I am saying is
[19:03:56] <kba> You're playing dumb.
[19:04:02] <greyTEO> kba, I would agree to that
[19:04:24] <greyTEO> relation with nosql is wrong. It is supported but frowned upon
[19:04:24] <StephenLynx> when you need relational integrity, you need a database that implements relational integrity.
[19:04:50] <shlant> StephenLynx: http://docs.mongodb.org/manual/reference/built-in-roles/#root
[19:04:53] <StephenLynx> you don't tackle a half-assed abomination that makes the database works against its design
[19:05:11] <kba> Before you said you needed a schema, because sometimes you need relational integrity.
[19:05:19] <StephenLynx> yes.
[19:05:37] <kba> That implies that you can't have good relational integrity without a schema.
[19:05:47] <StephenLynx> yeah.
[19:06:10] <kba> So sine MongoDB doesn't have schemas, the relational integrity is bad.
[19:06:10] <StephenLynx> how is the database going to enforce the relational integrity without a schema?
[19:06:14] <StephenLynx> no
[19:06:21] <kba> Why "no"?
[19:06:26] <StephenLynx> mongo DOESNT HAVE relational integrity.
[19:06:26] <kba> That's exactly what you said.
[19:06:27] <StephenLynx> period.
[19:06:32] <kba> Okay.
[19:06:33] <StephenLynx> is not bad, it isn't there at all.
[19:06:37] <kba> Right.
[19:07:34] <greyTEO> I think orm's introduce this thought to NoSQL dbs
[19:07:52] <kba> They do, by introducing a schema.
[19:08:02] <StephenLynx> odm's
[19:08:03] <greyTEO> they allow you to reference of other documents but you shouldn't be allowed to
[19:08:05] <kba> but StephenLynx argues that since I want my data structured, I should use RDBMS
[19:08:10] <StephenLynx> yes.
[19:08:21] <StephenLynx> if you want to do it right.
[19:08:24] <greyTEO> if you want data integrity then I would suggest the same
[19:08:31] <kba> Can you give me an example application where the data isn't structured, StephenLynx?
[19:08:51] <greyTEO> other wise, embed the entire document rather than reference it.
[19:09:11] <greyTEO> duplicate data(write heavy) is pretty common.
[19:09:12] <StephenLynx> I never advised against structuring your data. I use a structure without a schema.
[19:09:13] <kba> for the most part, I'm fine with the way it works now.
[19:09:25] <StephenLynx> it just isn't validated anywhere.
[19:09:33] <kba> StephenLynx: so you were needlessly pedantic when I said I needed a schema because I needed structure. Got it
[19:09:42] <StephenLynx> let me look for that
[19:09:51] <StephenLynx> I am pretty sure I didn't say that.
[19:10:16] <StephenLynx> "<StephenLynx> what keeps him to structure his data? <StephenLynx> you don't need a schema for that. <StephenLynx> him from*"
[19:10:24] <kba> That was 10 minutes later.
[19:10:25] <StephenLynx> not only but I said exactly the opposite
[19:10:36] <kba> I said I needed a schema, you said I needed a DBMS.
[19:10:44] <StephenLynx> "<StephenLynx> since mongo doesn't have relational integrity, I cannot see the point of schemas and validation rules."
[19:10:47] <StephenLynx> yes.
[19:10:54] <StephenLynx> a schema is not a structure.
[19:10:55] <kba> because we apparently don't share definition of schema
[19:11:02] <kba> in my book, a structure and a schema is pretty much the same
[19:11:12] <StephenLynx> a structure is a convention on how the data is saved.
[19:11:19] <kba> "A database schema (/ˈski.mə/ skee-mə) of a database system is its structure"
[19:11:51] <StephenLynx> a schema is a structure set in stone with constraints that cause errors when you try to input data that does not obey the schema.
[19:12:28] <kba> Indeed. So any MongoDB application that doesn't allow you to insert ANY data into ANY field has a schema?
[19:12:40] <kba> Because if there's validation, it has a schema, according to you
[19:12:44] <StephenLynx> yes.
[19:12:53] <StephenLynx> it is a schema implemented in the application, but its a schema.
[19:12:59] <kba> So 99%+ of application needs schema.
[19:13:02] <StephenLynx> no.
[19:13:13] <StephenLynx> how did you came up with that?
[19:13:16] <kba> So at least 1% of all applications developed has no validation?
[19:13:26] <StephenLynx> where are you pulling these numbers from?
[19:13:41] <kba> Nowhere.
[19:13:42] <StephenLynx> so
[19:13:50] <StephenLynx> they are meaningless and you are just talking bullshit?
[19:13:55] <kba> haha
[19:14:01] <kba> Good counter-argument
[19:14:05] <kba> Please give me the real numbers!
[19:14:16] <StephenLynx> numbers for what?
[19:14:39] <kba> You're ridiculous. You're saying that any application using validation shouldn't use MongoDB, because validation implies a schema, and if you need a schema, you should use an RDBMS.
[19:14:47] <StephenLynx> yes.
[19:14:50] <StephenLynx> pretty much that.
[19:15:13] <kba> Now you're just talking bullshit, then :)
[19:15:16] <StephenLynx> lol
[19:15:43] <StephenLynx> are you considering basic data sanitizing as "validation"?
[19:15:53] <kba> Rejecting input is validation.
[19:16:04] <StephenLynx> basic data sanitizing.
[19:16:13] <kba> You said that if you can get an error while entering data, then it needs a schema
[19:16:21] <kba> "<StephenLynx> since mongo doesn't have relational integrity, I cannot see the point of schemas and validation rules."
[19:16:22] <StephenLynx> an error on the database layer.
[19:16:33] <kba> StephenLynx a schema is a structure set in stone with constraints that cause errors when you try to input data that does not obey the schema.
[19:16:34] <StephenLynx> I was not talking about the application layer.
[19:16:39] <kba> Oh, you forgot that, didn't you?
[19:16:55] <kba> How convenient that you were so ambigiuous
[19:17:01] <cheeser> maybe i should just come back monday. :)
[19:17:12] <StephenLynx> input rejection on the application layer would be done regardless if the database enforces a schema.
[19:17:13] <greyTEO> gets popcorn
[19:17:29] <kba> Why are we talking about "the database enforcing a schema" now?
[19:17:34] <kba> This discussion started with Mongoose
[19:17:37] <kba> Mongoose isn't "the database"
[19:17:42] <kba> Mongoose works in the application layer
[19:17:52] <StephenLynx> no, but acts as the database layer as far as your application is concerned.
[19:18:01] <kba> Haha
[19:18:08] <kba> So having a good abstraction for validation means it's not part of the database?
[19:18:14] <kba> So having a good abstraction for validation means it's now part of the database?
[19:18:16] <kba> NOW*
[19:18:34] <StephenLynx> part of the layer that handles the database.
[19:18:53] <kba> Come again?
[19:19:12] <StephenLynx> the database layer might be more than just the database storing your data.
[19:19:34] <StephenLynx> if you have a middleware that does nothing but work with your database, it is part of the database layer.
[19:19:55] <kba> Must be convenient discussing when you're in charge of what's the right definition all the time.
[19:20:06] <kba> Like the fact that Mongoose is now the database layer.
[19:20:16] <kba> Because then the fact that Mongoose has validation is wrong, apparently.
[19:20:29] <kba> Mongoose also does validation, so it's not part of the database layer, StephenLynx.
[19:20:32] <kba> According to yourself.
[19:20:57] <StephenLynx> it enforces a schema. you will still want to perform input validation regardless.
[19:21:12] <kba> So is Mongoose part of the application or database layer now, StephenLynx?
[19:21:19] <StephenLynx> database layer.
[19:21:23] <kba> But Mongoose has validation.
[19:21:28] <kba> You said "if you have a middleware that does nothing but work with your database, it is part of the database layer.".
[19:21:34] <StephenLynx> no, it enforces a schema.
[19:21:47] <kba> That must imply that if the middleware DOES do more stuff than working with the database, then it is NOT part of the database layer
[19:21:49] <kba> No?
[19:22:09] <StephenLynx> it isn't doing more than just working with the database.
[19:22:17] <kba> It is doing validation.
[19:22:19] <StephenLynx> no
[19:22:23] <kba> It's not?
[19:22:23] <StephenLynx> it is enforcing a schema.
[19:22:26] <StephenLynx> its different.
[19:22:41] <kba> It's funny that the method in Mongoose literally is called "validate" then
[19:22:45] <StephenLynx> it will make sure you input a string, it won't check if the string is valid according to your application logic.
[19:22:50] <kba> It will.
[19:23:01] <kba> Have you used Mongoose, StephenLynx?
[19:23:03] <StephenLynx> no.
[19:23:06] <kba> Wow.
[19:23:11] <kba> So you're talking out of your ass now.
[19:23:15] <StephenLynx> lol
[19:23:15] <kba> Great