node-restful not saving Document "contents" to MongoDb node-restful not saving Document "contents" to MongoDb mongoose mongoose

node-restful not saving Document "contents" to MongoDb


Add a header in postman of

Content-Type : application/json

and instead of using form fields, send it with as raw json. Worked for me.


I never comment on stackoverflow but this was an issue for me several times and I seem to keep running into this. So, I'll like to HELP everyone.

First Set Header to Content-Type : application/json

Don't include : into Context-type.

Second choose raw for the input type. Though this isn't a JSON tutorial, postman notice the difference between single and double quotes.

Use double quotes which is this ", NOT ' and not ''. Second, double quote the key and if the value of the key is a string, double quote the expression.

It was always recommended that keys should be single strings (use camel hump notation if necessary). Being a so-called veteran of programming,

I though postman would handle if the keys for the JSON object was variables and not string because of the notation but maybe it is an issue with postman. A picture tells a thousand words so I included a picture.

Note that if you have issues add particular key, it might be your model. Go young grasshopper. (A)lways (B)e (C)oding

Regards!

Quentin Mayo.

P.S I have no affiliation with Postman but I strongly recommend it to anyone trying to work with an API.

I don't post enough to post images so if someone validates me, feel free to post re-post the image on this page(I just want to help others).http://postimg.org/image/6xmto3elj/


What worked for me was selecting x-www-form-urlencoded rather than the default selection of form-data