These are chat archives for deployd/deployd

25th
Mar 2017
safaorhan
@safaorhan
Mar 25 2017 08:37
@kkrishnan90 vuuv my post helped somebody :) That made my day :)
Younes Keraressi
@YounesKeraressi
Mar 25 2017 08:44

hey guys , its been a 3 days am playing with deployd, but is this an issue or there is another way to do that, on the user's event when am checking something on get method it repeat as much as users exist?

the users Get API its loop as much as element exist in the users collection, so am doing a simple check its repeat that many times as users so my question is , is there a way to stop default get and generate my own, or its there a way to execute my code in the user's Get even once the get method return all items thx

safaorhan
@safaorhan
Mar 25 2017 08:46
@YounesKeraressi I don't understand your question exactly. What do you want to achieve on GET /users
Younes Keraressi
@YounesKeraressi
Mar 25 2017 08:50
@safaorhan i have users collections lets say 3 users there, if i tape console.log its prints 3 times, so for each item my code inside get repeated 3 times, wanted to know if therse a way to get them all first then console.log once
@safaorhan or is there a way to stop get and return my code instead?
safaorhan
@safaorhan
Mar 25 2017 08:57

@YounesKeraressi I get it now. It's the expected behaviour because GET event script is executed for each single item in the collection. GET event script generally used for modifying the data on the fly and controlling access.

If you want to do something about all of the collection data (e.g. sorting the items, adding custom responses, etc) you should look at module: dpd-event

Younes Keraressi
@YounesKeraressi
Mar 25 2017 09:01
@safaorhan thx for your help :)
safaorhan
@safaorhan
Mar 25 2017 09:01
With dpd-event module, you can create a custom endpoint (event resource), say /myusers. In the GET event script of /myusers you can write some code like the following:
dpd.users.get({}, function(users, error) {
    // You can play with users here. Modify it.
    setResult(users);
});
Np :)
Younes Keraressi
@YounesKeraressi
Mar 25 2017 09:02
@safaorhan <3 :)
kkrishnan90
@kkrishnan90
Mar 25 2017 17:20
Hey guys.. does anyone know a way to pass a nested JSON parameter through a URL. Like I have a data which is a JSON object for every item. Now, I wanted to filter a certain list of items or item through passing a parameter which can compare the JSON object which is stored in the collection. Any one have ever tried this before ?
Let me give you an example , let's say I store a collection called users , and have a JSON object which stores the profile details like email, mobile ,etc inside the JSON object. Now when I type in a URL like '../users?Email=someone@gmail.com' .. it fails to filter it inside the profile JSON object that's stored.hope you guys got my point ?
Any help on this is much appreciated and I'll be very glad to know the possibilities too..