Skip to content

saveDocument without id #14

@drudderd

Description

@drudderd

I tried this:

db.saveDocument('Projects', { name: 'foo' }, function(err, results) { ... });

and got an error saying the method getMetadataValue does not exists on object.

I checked the HTTP api and your code and in my opinion the following is the problem:
file database.coffee line 82: you only 'convert' the given object to a document if it has an id, meaning that if it has no id, line 85 will throw an exception.

I changed the code, placing line 82 before the if statement on line 79, so I always convert the given object to a document and then run the 'id-logic' if neccessary. This works as expected.

Can someone verify this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions