Skip to content

Commit

Permalink
fix collection creation
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Jan 5, 2022
1 parent d8c6081 commit 55964bb
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions helpers/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,15 @@ client
;

const collectionName = 'tasks';
const read = ['*'];
const write = ['*'];
const rules = [
{
'label': 'completed',
'key': 'completed',
'type': 'boolean',
'default': false,
'required': true,
'array': false,
},
{
'label': 'text',
'key': 'text',
'type': 'text',
'default': '',
'required': true,
'array': false,
},
];
const read = ['role:all'];
const write = ['role:all'];

const promise = database.createCollection(collectionName, read, write, rules);
const promise = database.createCollection(collectionName, read, write);

promise.then(function(response) {
console.log('success');
database.createBooleanAttribute(response.$id, 'completed', true, false, false);
database.createStringAttribute(response.$id, 'text', 255, true, '', false);
}, function(error) {
console.log('error', error.type, error.message);
});
Expand Down

0 comments on commit 55964bb

Please sign in to comment.