Databases Reference
In-Depth Information
The response is 1 if the fi eld exists and 0 if it doesn't.
Going back to the set parking_facilities_set, you may just want to count the number of
members instead of listing them all using the SCARD command as follows:
SCARD parking_facilities_set
As expected, the response is 1912 . You could verify if a specifi c member exists in the set using the
SISMEMBER command. To verify if 1005006 is a member of the set, you could use the following
command:
SISMEMBER parking_facilities_set 1105006
Integral values of 0 and 1 are returned to depict false and true for this query that verifi es if a
member exists in a set.
SUMMARY
This chapter illustrated a few query mechanisms that are more advanced than those you have seen
so far. Querying was explained using examples. MongoDB querying details were explained using a
sample movies rating data set. The HBase example was illustrated using historical stock market data
and the Redis querying capabilities were demonstrated using sample NYC government data.
The coverage of the querying capabilities is not exhaustive and doesn't cover all types of use cases. The
use cases illustrated in this chapter are just some of the innumerable possibilities. However, walking
through the example should get you familiar with the style and mechanics of querying NoSQL data
stores.
Search WWH ::




Custom Search