stephe...@sinefa.com
unread,Mar 7, 2012, 10:43:33 PM3/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to persevere...@googlegroups.com
The blocked property in a schema doesn't affect the results of a query operation. It does work as expected for the get operation. This can be easily demonstrated with the below test:
var store = require('perstore/store/memory').Memory();
var model = require('perstore/model').Model(store, {
properties: {
prop1: {
type: String,
indexed: true
},
prop2: {
type: 'number',
indexed: true
}
}
});
var facet = require('perstore/facet').Permissive(model, {
properties: {
prop2: {
blocked: true
}
}
});
var when = require('promised-io/promise').when;
var assert = require('assert');
exports.testBlocked = function() {
model.put({ id: 1, prop1: 'hello', prop2: 100 });
var rGet = facet.get(1);
assert.equal(rGet['prop2'], undefined);
var rQuery = facet.query('id=1').get(0);
assert.equal(rQuery['prop2'], undefined);
}
if (require.main === module)
require('patr/runner').run(exports);
Is this the expected behaviour or is it a bug? If it's expected, what is the correct way to not return (to pintura's rest-store) certain fields in a query result?
Using perstore code from kriszyp/perstore v0.3.0-20-g7be9d6f (On a different note, should I be using persvr/perstore over kriszyp/perstore?)