MongoDB – Indexing
Indexes support the efficient resolution of queries. Without indexes, MongoDB must scan every document of a collection to select those documents that match the query statement. This scan is highly…
Indexes support the efficient resolution of queries. Without indexes, MongoDB must scan every document of a collection to select those documents that match the query statement. This scan is highly…
The current-time function is used to return the current time. Syntax current-time() Example XQuery Expression let $time := current-time() return <results> <time>{$time}</time> </results> Output <results> <time>14:53:46.803+05:30</time> </results> Verify the Result In order…
In this chapter, we will learn how to sort records in MongoDB. The sort() Method To sort documents in MongoDB, you need to use the sort() method. The method accepts a document…
The current-date function is used to return the current date. Syntax current-date() Example XQuery Expression let $date := current-date() return <results> <date>{$date}</date> </results> Output <results> <date>2014-10-27+05:30</date> </results> Here +5:30 is the relative…
In this chapter, we will learn how to limit records using MongoDB. The Limit() Method To limit the records in MongoDB, you need to use the limit() method. The method accepts one…
Interceptors are those which helps to obstruct or change requests or responses. Protocol interceptors in general act upon a specific header or a group of related headers. HttpClient library provides…
In MongoDB, projection means selecting only the necessary data rather than selecting the whole of the data of a document. If a document has 5 fields and you need to…
You can use the same SQL SELECT command into a PHP function mysql_query(). This function is used to execute the SQL command and then later another PHP function mysql_fetch_array() can be used to…
You can abort the current HTTP request using the abort() method, i.e., after invoking this method, on a particular request, execution of it will be aborted. If this method is invoked after…
If you are processing HTTP responses manually instead of using a response handler, you need to close all the http connections by yourself. This chapter explains how to close the…