2
votes

I am looking into using Google Datastore for a project of mine. I would like to retrieve all the keys of the entities but I would like it sorted by newest -> oldest:

query.select('__key__').order('DateCreated');;

query.run(function(err, entities) {
  var keys = entities.map(function(entity) {
    return entity[datastore.KEY];
  });
});

If inside of my entity I have a "Date Created" field can I use this field to sort the results while the query still being considered a "free" operation meaning it will cost me nothing to get the results? Or if I do sort this using my own attribute inside the entity does this then cost me something?

1

1 Answers

1
votes

Yes, they're still keys-only queries. From the Pricing and Quota:

Small Operations Unlimited Free

Small operations include calls to allocate Cloud Datastore IDs or keys-only queries.