[Answer]-How to save JSON from Vk.com API response to MongoDB?

1👍

That was simple and i am surprised that no answers:
i need to use raw Pymongo:

wallpost.save()  

is not correct, because save django model with predefined fields

VkWallPost._get_collection().insert(vk_post)

this is correct – we use raw pymongo insert

0👍

Well, did you see what do you have in wallposts variable?

Cause, I think, error message is pretty clear: in cycle variable wallpost you have int value. And, of course, trying to call save() will throw exception. May be, objects in wallposts have integer indices, do you think?

Try to print what you have in wallposts.

Leave a comment