These are chat archives for LearnBoost/mongoose

5th
Feb 2015
Meistercoach83
@Meistercoach83
Feb 05 2015 10:03
@vkarpov15 how can i always install the latest (unstable) versions of mongoose and mongodb via package.json? When I run mongoose "latest" I get 3.8.22 .. but i need the hooks from 4.0.0 ;-)
Valeri Karpov
@vkarpov15
Feb 05 2015 13:47
npm install mongoose@unstable --save or put "mongoose": "4.0.0-rc1" in your package.json. This is intentional - 4.0.0-rc1 isn't quite ready to be declared stable because it needs to support MongoDB 3.0, which still hasn't been released
@jrthib correct. Mostly, plugins just attach hooks to schemas
Meistercoach83
@Meistercoach83
Feb 05 2015 13:49
thank you!
Valeri Karpov
@vkarpov15
Feb 05 2015 13:49
@chetverikov no reason why not, as long as location_schema is a sensibly formatted object
Maksim
@chetverikov
Feb 05 2015 14:12
@vkarpov15 I didn't understand what you wanted to say. I wanted to use this Schema in order to use toObject transform is the same.
Valeri Karpov
@vkarpov15
Feb 05 2015 15:47
if location_schema is an actual Schema, then no, you would need to put it in an array for now, location: [globals_schemas.location_schema]
Maksim
@chetverikov
Feb 05 2015 16:06
@vkarpov15 Bad.... It seems to me that it would be a good ability! The code would be much cleaner and prettier. Tired of copy pieces of code from one place to another....
Valeri Karpov
@vkarpov15
Feb 05 2015 16:06
there's an issue open for that, I forget the number off the top of my head, but its a popular +1 and I hope to work on adding that after 4.0.0 is finally out :)
Maksim
@chetverikov
Feb 05 2015 16:13
@vkarpov15 damn... I could Not properly translate what you said :D
Cristian Wilgenhoff
@cwilgenhoff
Feb 05 2015 20:18
Hi guys, quick question ? is possible to have a field in the schema with a variable data type ?
Valeri Karpov
@vkarpov15
Feb 05 2015 20:33
@cwilgenhoff You can use the "Mixed" type, which means the type can be whatever. Also, there's nothing stopping you from saying var x = String and then setting myPath: { type: x } in your schema.
Cristian Wilgenhoff
@cwilgenhoff
Feb 05 2015 20:35
@vkarpov15 Thank you for not telling me RTFM, first page on mongoose schema types.
I'm burnt out at this hours
Thanks!
Valeri Karpov
@vkarpov15
Feb 05 2015 20:41
np. Good luck.