Projection in ottoman

8 views
Skip to first unread message

socket...@gmail.com

unread,
Aug 25, 2018, 6:26:23 AM8/25/18
to Couchbase
How can I use projection in node-ottoman to save network bandwidth ?

In the following model

var Furniture = ottoman.model('Furniture', {
name: 'string',
title: 'string',
AndManyManyOtherFields
}, {
index: {
findByName: {
by: 'name'
}
}
});

If I execute

Furniture.findByName('table', function(err, tables) {
  if (err) return console.error(err);
  console.log(tables);
})

The tables contains all fields that just kill network bandwidth , I only need some fields , How can I explicitly project some fields?

Reply all
Reply to author
Forward
0 new messages