When your filter finds no result, what does it return? Does it return a null value, an empty string, a json document describing the fact that there were no results found? If I were to run r\table('users')->filter(array('user_name' => $user_name))->run($this->r)
and there were no users found by that name, what would Rethink return?
I can't seem to find this on the extended docs for filter or the regular API documentation.
It returns an empty selection. Think of it like an empty array, or an empty enumerable, empty set,..depend on how your driver and type system of language.
I can't seem to find this on the extended docs for filter or the regular API documentation
You can try to get this yourself by using the Data Exploer(for quickly get the result) and typeOf
command.
r.db("rewl")
.table("issues")
.filter( function (item) {
return item('date').eq(r.now())
})
.typeOf()
It prints out:
"SELECTION<STREAM>"
You also should use RAW VIEW in Data Explorer because it shows raw data, such as instead of saying No result it shows an empty array []
. That helps when trying to learn ReQL.