Skip to content

CRUD and queries

barq.write(() => {
barq.create(Project, {
_id: new Barq.Types.ObjectId(),
name: 'Docs',
});
});
barq.write(() => {
const project = barq.objects(Project)[0];
project.name = 'Barq Docs';
});
barq.write(() => {
const project = barq.objects(Project)[0];
barq.delete(project);
});
const active = barq.objects(Project).filtered('archived == false');
const sorted = active.sorted('name');

Results are live. If a write changes matching objects, the result can update.