If the string to be searched is "S", you can use the following four methods:
- DB. Tables. Find ({"Name":/S /})
- DB. Tables. Find ({"Name":/^ s /})
- DB. Tables. Find ({"Name":/S .*/})
- DB. Tables. Find ({"Name":/. S .*/})
The following analyzes the differences between the results of these queries:
1) dB. City. Find ({"Region":/. New .*/})
A total of 765 records: including [new and high technologies. Hi-Tech Zone, huqiu. Yubei district (including northern New District )]
[Note: The result shows the queried data.Must be preceded by characters, Which is equivalent to DB. city. find ({"region ":/. new. /}), which is also equivalent to DB. city. find ({"region ":/. new /})]
-----------------------------------------------------------------------------
2) dB. City. Find ({"Region":/^ new /})
A total of 592 records: including [Xinhua. Xinzhou. Xindu. New City. New Area]
[Note: The result shows that the queryIt must start with the characters to be queried.]
-----------------------------------------------------------------------------
3) dB. City. Find ({"Region":/New .*/})
A total of 1357 records: The records contain [Xinhua. High technology. Yubei district (including the northern New Area ). High-tech zone, huqiu]
[Note: The result shows thatThe preceding characters may or may not exist., Equivalent to: DB. City. Find ({"region":/New /})]
-----------------------------------------------------------------------------
Finally, we analyze the record results. From the above three queries, we can see that the results of the first two queries are exactly the same as those of the last query, which is fully consistent with the annotations.