I am using loopback fileUploader to upload multiple images from angular client. It is required to sort all images by date_of_upload, so i am recording file properties in another model FileDetail
    {
  "name": "fileDetail",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {
    "name": {
      "type": "string",
      "required": true
    },
    "extension": {
      "type": "string",
      "required": true,
      "default": "jpeg"
    },
    "size": {
      "type": "number",
      "required": true
    },
    "owner": {
      "type": "string",
      "required": true
    },
    "date_of_upload": {
      "type": "date",
      "required": true,
      "default": "$now"
    }
  },
 //and others...
}
How to get the unique file details using find API like
obj.find(filter:{
  where:{
   name:'isUnique'
  }
}).$promise.then(successCb,errorCb);
or similar???
I had a look to loopback: distinct query but not targeted to APIs
via Bahodur Saidov
No comments:
Post a Comment