Start a new topic

Select distinct


Is it possible to make a "select distinct(column)" using your data store ?

(the features in MongoDB :

Thank you.

Hello Fabreax,

This is the type of thing that business logic is often used for. You can check out CollectionAccess here: Which is very likely what you are looking for.

Please let me know if you have any other questions,
Thanks a lot !
Why not including the "select distinct" feature in the standard API ?


This is the endpoint code for a distinct by user :


function onRequest(request, response, modules) {
  var userId=modules.requestContext.getAuthenticatedUserId();
  var aclQuery = {"_acl":{"creator":userId}};
 modules.collectionAccess.collection(request.body.collectionName).distinct(request.body.columnName, aclQuery, function (err, docs) {
  if (err) {
    modules.logger.error('Query failed: '+ err);
  } else {
    response.body = docs;


Login or Signup to post a comment