Service to interact with todo database
- Source:
Methods
(inner) deleteItem(id)
Delete specific item and from user todo array
Parameters:
Name | Type | Description |
---|---|---|
id |
String | ID representing todo object |
- Source:
(async, inner) findAllItems(userId) → {Document}
Gets all users from mongodb database
Parameters:
Name | Type | Description |
---|---|---|
userId |
String | User ID representing current user |
- Source:
Returns:
- Returns all todo documents for a given user
- Type
- Document
(inner) getItem(id) → {document}
Get specific document
Parameters:
Name | Type | Description |
---|---|---|
id |
String | ToDo ID string |
- Source:
Returns:
- returns document by ID field
- Type
- document
(async, inner) postItem(body, userid) → {Promise}
Post new item
Parameters:
Name | Type | Description |
---|---|---|
body |
Object | object representing todo item |
userid |
String | id for user that created the todo item |
- Source:
Returns:
– Promise to return document in mongoDB database
- Type
- Promise