Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about row(key).exists() #2702

Closed
briangruber opened this issue Oct 27, 2017 · 4 comments
Closed

Confused about row(key).exists() #2702

briangruber opened this issue Oct 27, 2017 · 4 comments
Assignees
Labels
api: bigtable Issues related to the Bigtable API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@briangruber
Copy link

I'm confused about using the exists() method on a row(key), hoping to get clarification.
If I want to check if a row exists I thought I would do this

table.row(key).exists().then(result => {
  let exists = result[0]
}

If the row does exists then I do step into the .then and exists will be true. But if it doesn't exist I actually get an exception of Unknown row: key. So, then what is the point of exists if when it doesn't exist it throws an error? Is result[0] expected to always be true and if it doesn't exist I'm supposed to use the exception? Or am I missing something?

Thanks!

@callmehiphop
Copy link
Contributor

Sounds like a bug! Just to confirm - are you reporting this for the Bigtable client?

@briangruber
Copy link
Author

Yes, this is for the node module @google-cloud/bigtable

@callmehiphop callmehiphop added api: bigtable Issues related to the Bigtable API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 27, 2017
@callmehiphop callmehiphop self-assigned this Oct 27, 2017
@stephenplusplus
Copy link
Contributor

cc @Chipintoza who reported this in googleapis/nodejs-spanner#23 (so you can track this)

@lukesneeringer
Copy link
Contributor

This issue was moved to googleapis/nodejs-bigtable#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants