Pretty much I am trying to create a REST interface using mongoose as
middleware, but using the same Schema, Model, Instance structure as
mongoose on the Web Side to CRUD data into a MongoDB.
So...
Given this simple JSON representation of a Schema...
"Schema":[{
"Name":"Documents",
"data":[
{"name":"author","type":"String"},
{"name":"title","type":"String"},
{"name":"body","type":"String"}
]
}]
how would I create a Schema, without using eval()...
I can create the Schema's with the correct names but the object passed
to Schema function has to have key values and SchemaTypes, not key
values and string representations of SchemaTypes...
So my question, if your not all the way confused is...
How do I build and object similar to
{ author:String,
title :String,
body :String}
using the JSON data above...
{ author:"String",
title :"String",
body :"String"}
DOES NOT WORK
String is not the same as "String", and I have not ideal how to
instantiate a String SchemaType using the string "String"
Thanks for your help,
Dom
something like obj.type = mongoose.Types["String"]...
or something to that effect...
and yes, this will be open sourced...
Dom
--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.