Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Neither 'unsel' nor 'sel' parameters work while querying custom objects from ACS

$
0
0

We are writing a web service using Node.ACS, checking the result using browser.

I've created dummy objects using admin panel. if I use following code everything works perfectly and I receive a proper response:

ACS.Objects.query({
    classname: "Dog",
    where: {
        birthdate: {
            $gte: currentDate
        }
    },
    order: "birthdate"
}, function (e) {
    if (e.success) {
        var dogs = e.Dog;
        res.json({
            'response': dogs,
            'success': 'true'
        });
    } else {
        res.json(e);
    }
});
However if I add "unsel" or "sel" parameter - it doesn't work. Even without any items in the array
ACS.Objects.query({
    classname: "Dog",
    where: {
        birthdate: {
            $gte: currentDate
        }
    },
    unsel:{"all":["updated_at", "user", "acls"]},
    order: "birthdate"
}, function (e) {
    if (e.success) {
        var dogs = e.Dog;
        res.json({
            'response': dogs,
            'success': 'true'
        });
    } else {
        res.json(e);
    }
})
This is the response:
{
  "success": false,
  "error": true,
  "code": 400,
  "message": "A JSON text must at least contain two octets!"
}
Some additional information - I am using a custom object with relational fields in it (references to other custom objects).

Everything is according to the documentation, I just cannot get it working. Could you show me an example that works?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>