If the query is correct, and nothing is wrong, no error will be returned, but a nil value will be return instead. Think about SQL, it return an empty set of row instead throwing error, because nothing is wrong with query nor the server connection.
I don't know Python, but in JavaScript or Ruby, a null
/nil
value will be returned
Run this on Data Exploer and you get a null
result
r.table('foo').get('anivalidprimarykey')
Or in JavaScript:
r.table('foo').get('anivalidprimarykey').run(connection)
.then(function(result) {
console.log('r=', result)
})
.error(function(err) {
console.log('e=', err)
})
You will get a null
value for result
variable.
Same thing with Ruby, though you get a nil
value.
require 'rethinkdb'
include RethinkDB::Shortcuts
r.connect.repl
r.table(:foo).get('an_in_valid_key').run
nil
So I assume that the Python driver will do same, return a nil value in your language.