Re: How to save the whole schema while not explicitly defining some of the fields

2016-09-19 Thread Michael Donux
Sorry for that, I'll delete the post.

On Monday, September 19, 2016 at 11:46:35 PM UTC+8, Sergey Lyubka wrote:
>
> Wrong mailing list.
> This list is dedicated to https://github.com/cesanta/mongoose
>
> On Mon, Sep 19, 2016 at 11:18 AM, Michael Donux  > wrote:
>
>> Hi, my question is the title. And my example is as below:
>>
>> var catSchema = new Schema({
>> name: String,
>> color: String,
>> });
>>
>> var Cat = mongoose.model('Cat', catSchema);
>>
>> Cat.create({ name: 'me' }, function(err, result) {
>> console.log(result);
>> });
>>
>> Is it possible to get the doc saved with both `name` field and `color` 
>> field?
>> Or do I have to explicitly set the `color` to `null`?
>>
>> I'm hoping for all suggestions.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "mongoose-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mongoose-user...@googlegroups.com .
>> To post to this group, send email to mongoos...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/mongoose-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at https://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.


Re: How to save the whole schema while not explicitly defining some of the fields

2016-09-19 Thread Sergey Lyubka
Wrong mailing list.
This list is dedicated to https://github.com/cesanta/mongoose

On Mon, Sep 19, 2016 at 11:18 AM, Michael Donux 
wrote:

> Hi, my question is the title. And my example is as below:
>
> var catSchema = new Schema({
> name: String,
> color: String,
> });
>
> var Cat = mongoose.model('Cat', catSchema);
>
> Cat.create({ name: 'me' }, function(err, result) {
> console.log(result);
> });
>
> Is it possible to get the doc saved with both `name` field and `color`
> field?
> Or do I have to explicitly set the `color` to `null`?
>
> I'm hoping for all suggestions.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongoose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongoose-users+unsubscr...@googlegroups.com.
> To post to this group, send email to mongoose-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/mongoose-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at https://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.


How to save the whole schema while not explicitly defining some of the fields

2016-09-19 Thread Michael Donux
Hi, my question is the title. And my example is as below:

var catSchema = new Schema({
name: String,
color: String,
});

var Cat = mongoose.model('Cat', catSchema);

Cat.create({ name: 'me' }, function(err, result) {
console.log(result);
});

Is it possible to get the doc saved with both `name` field and `color` 
field?
Or do I have to explicitly set the `color` to `null`?

I'm hoping for all suggestions.

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at https://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.