Skip to content

Feedback from Insert Method #71

Open
@aprelle

Description

@aprelle

In comparison to the other methods, e.g. update, insert does not deliver any result:

result = runtime.require('db').collections().Person.insert({
'_id': 'luke',
'firstName': 'Luke',
'lastName': 'Skywalker'
});

Here, result is always Array(0) [], whether an element was added or not. The only hint is a message:

runtime: unknown property 'XXX' for the definition of 'Person'
runtime: invalid document ....

Which I cannot catch (any hint how I can do it will be appreciated), since it is not an error.

Would it be possible to update the method, so it returns, e.g.

  • 1, when an element was successfully inserted,
  • 0, otherwise?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions