Create collections if they aren't there with save() #2

Merged
merged 1 commit into from Jan 4, 2013

Conversation

Projects
None yet
2 participants
Contributor

e1ven commented Jan 4, 2013

I don't know if there's a better way to do this, but I added a function to automatically create collections if they aren't there.
In regular mongo, it'll save data to a collection without having to explicitly create it first, so having this makes using it easier ;)

I did it as an exception, to avoid having to do a sql lookup before each insert.
I've never written plv8 before, but it seems to work ;)

-CPD

Owner

JerrySievert commented Jan 4, 2013

i like it.

JerrySievert added a commit that referenced this pull request Jan 4, 2013

Merge pull request #2 from e1ven/master
Create collections if they aren't there with save()

@JerrySievert JerrySievert merged commit cfb3ca7 into JerrySievert:master Jan 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment