Skip to content

transaction.get() is undocumented and buggy #783

Open
@kaansoral

Description

@kaansoral
  1. I can't see .get() documented here: https://googleapis.dev/nodejs/datastore/latest/Transaction.html
  2. Like all annoying Node.js methods, even if you provide a single key to it, it returns an array with that entity
  3. It seems to work if you provide an array of keys to it, but instead of returning an array of entities, it returns an array of an array that have the first entity in it's 0th slot (This is a bug, it shouldn't work at all)

Some bonus questions to whoever designed this entire API:

  1. Why datastore.key(['Kind',key]) instead of datastore.key('Kind',key)
  2. For the regular datastore.get (and this one too), providing a single key returns an array including that single element, can you sleep at night?

Coming from a Python NDB background, I really don't understand these decisions, even from a JS standpoint, they don't make sense

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: datastoreIssues related to the googleapis/nodejs-datastore API.type: cleanupAn internal cleanup or hygiene concern.type: docsImprovement to the documentation for an API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions