A B C D E F G H I J K L M N O P Q R S T U V W
!== (both value and type are not equal) operator, 42
!= (is not equal) operator, 42
! (not) operator, 42
$add operator, 175
$all operator, 110
$and operator, 110
$avg operator, 173
$bit operator, 147
$concat operator, 175
$divide operator, 175
$each operator, 147
$elemMatch operator, 110
$exists operator, 110
$first operator, 173
$gte operator, 110
$gt operator, 110
$inc operator, 147
$in operator, 110
$last operator, 173
$lte operator, 110
$lt operator, 110
$match operator, 172
$max operator, 173
$min operator, 173
$multiply operator, 175
$ne operator, 110
$nin operator, 110
$nor operator, 110
$not operator, 110
$ operator, 147
$or operator, 110
$pop operator, 147
$project operator, 172
$pullAll operator, 147
$pull operator, 147
$regex operator, 110
$rename operator, 147
$setOnInsert operator, 147
$set operator, 147
$size operator, 110
$skip operator, 172
$slice operator, 147
$strcasecmp operator, 175
$substr operator, 175
$subtract operator, 175
$sum operator, 173
$toLower operator, 175
$toUpper operator, 175
$type operator, 110
$unset operator, 147
$unwind operator, 172
% (modulous) operator, 40
&& (and) operator, 42
* (multiplication) operator, 40
+ (addition) operator, 40
++ (increment) operator, 40
‑‑ (decrement) operator, 40
‑ (subtraction) operator, 40
/ (division) operator, 40
() (parentheses), 50
< (is less than) operator, 42
<= (is less than or equal to) operator, 42
=== (both value and type are equal) operator, 42
== (is equal to) operator, 42
> (is greater than) operator, 42
>= (is greater than or equal to) operator, 42
|| (or) operator, 42
accessing
access control, configuring, 78‑82
GridFS Stores, 484
Node.js applications, 498, 500‑501
HTTP interfaces, 26
Java applications, 209
finding distinct field values, 218‑221
MongoGridFS objects in PHP, 490
Node.js applications, 391
objects, 12
PHP applications, 273
searching distinct field values, 281‑283
Python application, 331
grouping results, 341
accounts
authentication, starting, 79
database administrator, formatting, 79
users
administrator, formatting, 78
formatting, 72
ACID (Atomic, Consistency, Isolation, Durability), 7
adding
documents
files, GridFS Stores, 485, 491, 494, 498
items to arrays, 63
objects, 12
shards to clusters, 473
addition (+) operator, 40
addUser() method, 70, 87, 187, 370
add_user() method, 313
admin database
access control, configuring, 78‑82
overview of, 69
user accounts, managing, 70‑78
aggregate() method, 89, 172, 188, 225, 254, 314, 345, 371
aggregation
operators
pipelines, 176
and (&&) operator, 42
anonymous functions, 51
append() method, 192
applications
Java. See Java applications
Node.js. See Node.js applications
PHP. See PHP applications
Python. See Python applications
applying
pipelines, 176
anonymous functions, 51
results, mapReduce() method, 178‑183
arbiter servers, 460
Array objects, PHP applications, 257
arrays, 39
combining, 62
fields
contents, 118
searching documents based on, 118
items
adding/deleting, 63
searching, 63
iterating through, 62
manipulating, 61
strings
converting, 62
splitting, 58
values, searching documents based on, 117
assigning
roles, 71
values to variables, 38
assignment operators, 41
Atomic, Consistency, Isolation, Durability. See ACID
atomic write operations, 15
authenticate() method, 187, 253, 313, 370
authentication, starting, 79
auth() method, 87
auth setting, 24
background property, 440
backing up
BasicDBObject object, Java applications, 191‑194
batchInsert() method, 254, 294
batchSize() method, 108, 188, 256, 373
batch_size() method, 316
binary JSON. See BSON
bind_ip setting, 24
blocks
finally, 66
try/catch, 65
Booleans, 39
both value and type are equal (===) operator, 42
both value and type are not equal (!==) operator, 42
BSON (binary JSON), 9
callback functions, 368
capped collections, formatting, 14‑15, 436‑437
changeUserPassword() method, 87
characters, null, 9
clients, shells
cloneCollection() method, 87
cloneDatabase() method, 87
close() method, 186, 191, 252, 312, 368
clusterAdmin role, 71
privileges, 91
clusters, sharding
adding, 473
deploying, 472
code property, 145
collection_names() method, 313
Collection object, 89
Python application, 313
collections, 9
capped, formatting, 14‑15, 436‑437
design, 16
documents. See also documents
configuring write concerns, 143‑144
database update operators, 146‑147
error handling, 144
manipulating, 143
paging, 136
PHP applications, 294
status of database write requests, 145
lists, viewing, 96
managing, 96
sharding, enabling, 474
users, counting documents, 126
collections() method, 370
column store databases, 7
combining
arrays, 62
strings, 58
command‑line parameters, 22-23
commands
<database>, 87
use <new_database_name>, 92
comparison operators, 42
compound indexes, 439
cond parameter, 168
configuring
databases, 22
error handling, 144
PHP application write concerns, 257
servers, 461
sharding tag ranges, 475
connect() method, 186, 252, 368
Connection objects, overview of, 86
connectionId property, 145
connections
databases, configuring error handling, 144
write concerns, configuring, 143‑144
consoles, starting shells, 28
constructors, shells, 29
contents, searching, 118
converting
arrays into strings, 62
records, 9
copy() method, 191
copyDatabase() method, 87
copyTo() method, 89
count() method, 89, 108, 126, 188, 202, 254, 256, 265, 314, 316, 324, 371, 373, 383
countWords() method, 202
create_collection() method, 313
createCollection() method, 87, 97, 187, 253, 370
createIndex() method, 89
current() method, 256
documents, counting, 126
Node.js applications, 373
Python applications, 315, 324, 327, 332
results
customizing objects, defining, 54‑55
data life cycles, 17
data types
<database> command, 87
Python applications, 313
database_names() method, 312
databases
access control, implementing, 80
admin, overview of, 69
administrator accounts, formatting, 79
Collection object, 89
collections, managing, 433‑437
column store, 7
configuring, 22
Connection objects, overview of, 86
connections, configuring error handling, 144
document store, 6
graph store, 7
key‑value, 6
lists, viewing, 91
managing, 91
modifying, 92
results
roles, assigning, 71
sharding, enabling, 474
shells, managing, 433
statistics, viewing, 94‑96, 443‑444
testing, 31
users, listing, 74
write concerns, configuring, 143‑144
dataset examples, implementing, 100‑103
dataSize() method, 89
DB object
Java applications, 187
PHP applications, 253
db() method, 368
dbAdminAnyDatabase role, 71
dbAdmin role, 71
DBCollection object
Java applications, 188
PHP applications, 279
DBCursor object, Java applications, 189‑191, 202, 204, 210, 213
declaring variables, 38
decrement (‑‑) operator, 40
default_id indexes, 439
defining
documents, 13
functions, 49
deleting
documents
collections, 236
files, GridFS Stores, 486, 491, 495, 499
indexes, 441
items from arrays, 63
objects, 12
users, 77
deploying
sharding clusters, 472
diagnostics, managing databases, 443‑453
Dictionary objects, PHP applications, 317
displayGroup() method, 284
displayWords() method, 131
distinct field values
distinct() method, 138, 188, 254, 314, 316, 339, 371
distinctField() method, 89
division (/) operator, 40
document store databases, 6
documents
collections, 9. See also collections
configuring write concerns, 143‑144
database update operators, 146‑147
error handling, 144
status of database write requests, 145
distinct field values, retrieving, 139
embedding, denormalizing data, 13‑14
Java applications
manipulating, 143
Node.js applications, 411
objects used as, 374
paging, 397
searching distinct field values, 400‑402
parameters, PHP Arrays objects as, 257
PHP applications, 293
Python application, 349
references, normalizing data, 12‑13
results
sizing, 10
specific, retrieving (using PHP), 262‑265
specific sets of, searching, 117‑122
updating, 15
values, searching, 118
do/while loops, 45
drivers
drop() method, 89, 188, 254, 314, 371
drop_collection() method, 313
drop_database() method, 312
drop_index() method, 314
dropCollection() method, 370
dropDatabase() method, 87, 93, 186-187
dropDups property, 440
dropIndex() method, 89, 188, 254
embedding documents, denormalizing data, 13‑14
enabling sharding
collections, 474
databases, 474
engines, starting/stopping, 22
ensureIndex() method, 89, 188, 254, 314
err property, 145
errors
handling
document collections, 144
throwing, 66
escape codes, string objects, 56
‑‑eval command‑line option, 31‑32
eval() method, 87
evaluating
example datasets, implementing, 100‑103
executing
shell scripting, 32
variables, 38
exit command, 28
expression operators, aggregation, 173‑175
expressions, evaluating shells, 31‑32
fault tolerance, 462
fields
addUser() method, 70
arrays
contents, 118
searching documents based on, 118
naming, 9
Node.js applications, 394
parameters, 213
PHP applications, limiting, 276
Python applications, limiting, 334
values
searching, 117, 138‑140, 218‑221
fields:value operator, 110
files
configuration settings, 24
GridFS Stores
listing, 485
retrieving, 486, 491, 495, 499
finalize option, 179
finalize parameter, 168
finally blocks, 66
find operations
find() method, 89, 107, 112, 126, 188, 254, 259, 314, 371, 377
fields, limiting, 132
find_and_modify() method, 314
find_one() method, 314
findAndModify() method, 89, 188, 254, 371
finding. See searching
findOne() method, 89, 188, 194, 254, 259, 371
findone() method, 112
results, grouping, 167‑171, 221‑225
forEach() method, 108
formatting. See also design
capped collections, 14‑15, 436‑437
config servers, instances, 472
database administrator accounts, 79
example datasets, 101
users
accounts, 72
administrator accounts, 78
frameworks, aggregation operators, 174‑172
fromdb parameter, 434
fromhost parameter, 434
functions
anonymous, applying, 51
callback, 368
defining, 49
greeting(), 50
print(), 32
values, returning, 50
variables, passing, 50
generating new data results, 178‑183
geospatial indexes, 439
getCollection() method, 87, 187
getCollectionNames() method, 96
getConnections() method, 252
getDatabaseNames() method, 186
getIndexes() method, 89
getLastError() method, 187
getMongo() method, 87
getName() method, 87
getNext() method, 256
getReadPrefMode() method, 86
getReadPrefTagSet() method, 86
getSiblingDB() method, 87
getStats() method, 188
graph store databases, 7
greeting() function, 50
GridFS Stores
files
retrieving, 486, 491, 495, 499
implementing, 481
Node.js applications
Python
group() method, 89, 168, 188, 254, 314, 371
grouping
Python applications, 341
growth, documents, 15. See also updating
hashed indexes, 439
hasNext() method, 108, 191, 256
Hello World, 49
help <option> command, 28
help() method, 87
high availability, replication, 460
hint() method, 108
horizontal scaling, 6
hostInfo() method, 87
HTTP interfaces, accessing, 26
if statements, applying, 43‑44
implementing, 6
access control, 80
GridFS Stores, 481
in Java applications, 185. See also Java applications
replication, 459
strategies, 7
switch statements, 44
upsert, 158
increment (++) operator, 40
indexes, 16
collections, reindexing, 441‑443
deleting, 441
indexOf() method, 58
initial parameter, 168
insert() method, 89, 158, 188, 231, 254, 314, 371
inserting, 149. See also adding
installing MongoDB, 22
instances, formatting config servers, 472
interfaces
HTTP, 26
REST, 26
interrupting loops, 47
is equal to (==) operator, 42
is greater than (>) operator, 42
is greater than or equal to (>=) operator, 42
is less than (<) operator, 42
is less than or equal to (<=) operator, 42
is not equal (!=) operator, 42
isAuthenticated() method, 187
isCapped() method, 89
items, arrays
adding/deleting, 63
searching, 63
iterating through arrays, 62
iterator() method, 191
Java applications, 185
data access, 209
finding distinct field values, 218‑221
DB object, 187
DBCollection object, 188
DBCursor object, 202, 204, 210
documents
GridFS Stores, implementing, 484‑489
MongoClient object, 186
results, paging, 215
JavaScript
operators, 40‑44. See also operators
variables
journal setting, 24
jsMode option, 179
key‑value databases, 6
keyf parameter, 168
keys
values
keywords
function, 49
return, 50
var, 38
lastOp property, 145
life cycles, data, 17
limiting
Node.js applications, 394
PHP applications, 276
Python applications, 334
results
limit option, 179
limit() method, 108, 130, 136, 191, 210, 216, 256, 274, 316, 332, 373
limitResults() method, 210
listCollections() method, 253
listDBs() method, 252
listing files, GridFS Stores
Java, 485
Node.js applications, 498
Python, 494
lists
collections, viewing, 96
databases, viewing, 91
users, 74
literals, objects, 39
load() method, 32
log [name] : command, 28
logappend setting, 24
logout() method, 87
logpath setting, 24
lookups, denormalized documents, 13
looping
do/while loops, 45
interrupting, 47
variables, 38
while loops, 45
main() method, 202
managing
access control, configuring, 78‑82
collections, 96
configuration settings, 23
databases, 91
shells, 433
manipulating. See also modifying
arrays, 61
documents, 143
GridFS Stores
requests, applying aggregation, 171‑178
results, 181
max() method, 108
maxConns setting, 24
methods
add_user(), 313
aggregate(), 89, 172, 188, 225, 254, 314, 345, 371
append(), 192
auth(), 87
authenticate(), 187, 253, 313, 370
batch_size(), 316
batchSize(), 108, 188, 256, 373
changeUserPassword(), 87
cloneCollection(), 87
cloneDatabase(), 87
close(), 186, 191, 252, 312, 368
Collection objects, 89
collection_names(), 313
collections(), 370
Connection objects, 86
copy(), 191
copyDatabase(), 87
copyTo(), 89
count(), 89, 108, 126, 188, 202, 254, 256, 265, 314, 316, 324, 371, 373, 383
countWords(), 202
create_collection(), 313
createCollection(), 87, 97, 187, 253, 370
createIndex(), 89
current(), 256
Cursor object, 108
Database objects, 87
database_names(), 312
dataSize(), 89
DB objects, 187
db(), 368
DBCollection objects, 188
DBCurosor objects, 191
displayGroup(), 284
displayWords(), 131
distinct(), 138, 188, 254, 314, 316, 339, 371
distinctField(), 89
drop(), 89, 188, 254, 314, 371
drop_collection(), 313
drop_database(), 312
drop_index(), 314
dropCollection(), 370
dropDatabase(), 87, 93, 186-187
ensureIndex(), 89, 188, 254, 314
eval(), 87
find(), 89, 107, 112, 126, 188, 254, 259, 314, 371, 377
find_and_modify(), 314
find_one(), 314
findAndModify(), 89, 188, 254, 371
findOne(), 89, 188, 194, 254, 259, 371
findone(), 112
forEach(), 108
getCollectionNames(), 96
getConnections(), 252
getDatabaseNames(), 186
getIndexes(), 89
getLastError(), 187
getMongo(), 87
getName(), 87
getNext(), 256
getReadPrefMode(), 86
getReadPrefTagSet(), 86
getSiblingDB(), 87
getStats(), 188
group(), 89, 168, 188, 254, 314, 371
help(), 87
hint(), 108
hostInfo(), 87
indexOf(), 58
insert(), 89, 158, 188, 231, 254, 314, 371
isAuthenticated(), 187
isCapped(), 89
iterator(), 191
limit(), 108, 130, 136, 191, 210, 216, 256, 274, 316, 332, 373
limitResults(), 210
listCollections(), 253
listDBs(), 252
load(), 32
logout(), 87
main(), 202
max(), 108
min(), 108
native, shells, 29
new Mongo (), 86
objsLeftInBatch(), 108
open(), 368
partitions, selecting, 471‑472
print(), 40
printjson(), 40
push(), 60
readPref(), 108
reIndex(), 89
remove(), 89, 161, 188, 236, 254, 297, 314, 371
remove_user(), 313
renameCollection(), 89
repairDatabase(), 87
resetDoc(), 242
save(), 89, 155, 188, 239, 254, 299, 314, 371
selectDB(), 252
serverStatus(), 87
setReadPreference(), 186-188, 252-254, 313
setReadPrefMode(), 86
setSlaveOk(), 86
showWord(), 300
shutdownServer(), 87
skip(), 108, 136, 191, 216, 256, 316, 373
snapshot(), 108
sort(), 108, 128, 191, 204, 256, 267, 316, 326, 373, 386
split(), 58
storageSize(), 89
String object, manipulating, 56
totalIndexSize(), 89
totalSize(), 89
update(), 89, 188, 242, 254, 302, 305, 314, 371
validate(), 92
version(), 87
min() method, 108
modifying
databases, 92
objects, 12
modulous (%) operator, 40
MongoClient object
Java applications, 186
Node.js applications, 368
PHP applications, 252
Python applications, 312
MongoCollection object, PHP applications, 253‑254
MongoCursor object, PHP applications, 256, 274-276
MongoDB. See also databases
HTTP interfaces, accessing, 26
installing, 22
Java applications. See Java applications
shells
starting, 22
stopping, 25
MongoDB object, PHP applications, 253
MongoGridFS objects in PHP, accessing, 490
multikey indexes, 439
multiple documents, searching, 115. See also documents
multiplication (*) operator, 40
n property, 145
name property, 440
naming
fields, 9
variables, 38
native methods, shells, 29
new Mongo () method, 86
noauth setting, 24
Node.js applications, 367
Cursor objects, 373
data access, 391
documents, 411
paging, 397
searching distinct field values, 400‑402
GridFS Stores
MongoClient object, 368
objects used as documents/parameters, 374
specific documents, 380
nohttpinterface setting, 24
NoSQL
overview of, 6
not (!) operator, 42
null characters, 9
null variables, 39
number
of replica sets, 462
of servers, 462
numbers, 38
objects, 9. See also documents
arrays, manipulating, 61
Collection, 89
Connection, overview of, 86
counting documents, 126
DB, 187
DBCollection, 188
DBCursor, 189‑191, 202, 204, 210
drivers
grouping, 169
key values, grouping, 284
literals, 39
MongoClient, 186
Node.js applications, used as documents/parameters, 374
patterns, prototyping, 55
planning, 11
strings, escape codes, 56
objsLeftInBatch() method, 108
ok property, 145
open() method, 368
operations, atomic write, 15
operator parameter, 287
operators
$, 148
$add, 175
$all, 110
$and, 110
$avg, 173
$bit, 148
$concat, 175
$divide, 175
$each, 148
$elemMatch, 110
$exists, 110
$first, 173
$gt, 110
$gte, 110
$in, 110
$inc, 147
$last, 173
$lt, 110
$lte, 110
$match, 172
$max, 173
$min, 173
$multiply, 175
$ne, 110
$nin, 110
$nor, 110
$not, 110
$or, 110
$pop, 148
$project, 172
$pull, 148
$pullAll, 148
$regex, 110
$rename, 147
$set, 148
$setOnInsert, 147
$size, 110
$skip, 172
$slice, 148
$strcasecmp, 175
$substr, 175
$subtract, 175
$sum, 173
$toLower, 175
$toUpper, 175
$type, 110
$unset, 148
$unwind, 172
addition (+), 40
aggregation
and (&&), 42
assignment, 41
both value and type are equal (===), 42
both value and type are not equal (!==), 42
comparison, 42
decrement (‑‑), 40
division (/), 40
fields:value, 110
increment (++), 40
is equal to (==), 42
is greater than (>), 42
is greater than or equal to (>=), 42
is less than (<), 42
is less than or equal to (<=), 42
is not equal (!=), 42
modulous (%), 40
multiplication (*), 40
not (!), 42
or (||), 42
subtraction (‑), 40
options, ‑‑eval command‑line, 31‑32
or (||) operator, 42
out option, 179
outputting data in shells, 40
paging
documents, Node.js applications, 397
requests, 128
results, 136
Java applications, 215
PHP applications, 278
Python applications, 336
parameters
documents, PHP Arrays objects as, 257
fields, 213
group() method, 168
Node.js applications, objects used as, 374
operator, 287
projection, 133
parentheses (()), 50
partitions, selecting methods, 471‑472
passing variables to functions, 50
patterns, prototyping objects, 55
performance, 17
replication, 460. See also replication
PHP applications, 251
Array objects, 257
data access, 273
searching distinct field values, 281‑283
DB object, 253
DBCollection object, 279
Dictionary objects, 317
documents, 293
fields, limiting, 276
GridFS Stores, implementing, 489‑493
MongoClient object, 252
MongoCollection object, 253‑254
MongoCursor object, 256, 274-276
MongoDB object, 253
results, paging, 278
write concerns, configuring, 257
pipelines, applying aggregation, 176
port setting, 24
primary servers, 460
print() function, 32
print() method, 40
printjson() method, 40
privileges, clusterAdmin role, 91
projection parameter, 133
prototyping object patterns, 55
push() method, 60
Python applications, 311
Collection object, 313
data access, 331
grouping results, 341
Database object, 313
distinct field values, 339‑341
documents, 349
fields, limiting, 334
GridFS Stores
MongoClient object, 312
results, paging, 336
queries
routers, 469
starting, 473
query options, 179
RAM (random access memory), 10
random access memory. See RAM
RDBMSs (relational database management systems), 6‑8
read role, 71
read_preference() method, 312-314
readAnyDatabase role, 71
readPref() method, 108
readWrite role, 71
readWriteAnyDatabase role, 71
records, converting, 9
reduce parameter, 168
references, normalizing data, 12‑13
reIndex() method, 89
reindexing collections, 441‑443
relational database management systems. See RDBMSs
reliability, 7
remove() method, 89, 161, 188, 236, 254, 297, 314, 371
remove_user() method, 313
removeUser() method, 87, 187, 370
removing. See deleting
renameCollection() method, 89
repairDatabase() method, 87
replacing words in strings, 58
replica sets. See also replication
types of, 460
strategies, applying, 461
requests
manipulating, applying aggregation, 171‑178
Node.js applications, 374
paging, 128
PHP applications, applying aggregation, 287‑290
status of database write, retrieving, 145
resetDoc() method, 242
REST interfaces, 26
rest setting, 24
Java applications
paging, 215
limiting
manipulating, 181
mapReduce() method, applying, 178‑183
Node.js applications
paging, 136
PHP applications
paging, 278
Python application
Python applications
grouping, 341
paging, 336
retrieving
distinct field values, 139, 219, 282, 400
documents
Python applications, 319
using Java, 195
files, GridFS Stores, 483, 486, 491, 495, 499
specific documents (using PHP), 262‑265
status of database write requests, 145
return keyword, 50
returning
fields, limiting, 212
objects, 132
values from functions, 50
reviewing documents, PHP applications, 260‑262
roles
assigning, 71
clusterAdmin privileges, 91
routers
queries, 469
starting, 473
save() method, 89, 155, 188, 239, 254, 299, 314, 371
saving
documents
scalability, 6
scope
options, 179
executing, 32
searching
array items, 63
contents, 118
distinct field values, 138‑140, 218‑221
documents
multiple documents, 115
specific documents, Node.js applications, 380
specific sets of documents, 117‑122
substrings in strings, 58
secondary servers, 460
selectCollection() method, 252-253
selectDB() method, 252
selecting
servers
replication, 460. See also replication
sharding, types of, 469
serverStatus() method, 87
setReadPreference() method, 186-188, 252,-254, 313
setReadPrefMode() method, 86
sets, results. See also results
limiting access in Java applications, 209‑218
setSlaveOk() method, 86
setup. See configuring
setWriteConcern() method, 186-188
shard servers, 469
clusters
adding, 473
deploying, 472
collections, enabling, 474
databases, enabling, 474
servers, types of, 469
tag ranges, configuring, 475
shells
aggregation, applying, 171‑178
clients
constructors, 29
databases, managing, 433
documents
adding to collections, 149‑151
expressions, evaluating, 31‑32
GridFS Stores, implementing, 482‑484
native methods, 29
objects, grouping, 222
results
starting, 28
user accounts, formatting, 72
show <option> command, 28
showWord() method, 300
shutdownServer() method, 87
single field indexes, 439
sizing
collection design, 16
documents, 10
Node.js application results, limiting, 392‑394
results, limiting by, 210
skip() method, 108, 136, 191, 216, 256, 316, 373
slaveOk parameter, 434
snapshot() method, 108
sort option, 179
sort() method, 108, 128, 191, 204, 256, 267, 316, 326, 373, 386
sparse property, 440
specific documents
Node.js applications, 380
Python applications, 321
specific sets of documents, searching, 117‑122
specifying JavaScript files, 32‑33
speed, 7
split() method, 58
splitting strings into arrays, 58
starting
authentication, 79
MongoDB, 22
query routers, 473
shells, 28
statements
return, 50
switch, implementing, 44
statistics, viewing, 94‑96, 443‑444
status of database write requests, retrieving, 145
stopping MongoDB, 25
storage, GridFS Stores, 483
storageSize() method, 89
strategies, 7
strategies, applying replication, 461
strings
arrays
converting, 62
splitting, 58
combining, 58
objects, escape codes, 56
substrings, searching, 58
words, replacing, 58
subdocuments, 9, 118. See also documents
subobjects, 13. See also objects
substrings, searching strings, 58
subtraction (‑) operator, 40
switch statements, implementing, 44
tag ranges, configuring sharding, 475
testing databases, 31
text indexes, 439
throwing errors, 66
Time To Live. See TTL
toArray() method, 108, 191, 373
todb parameter, 434
totalIndexSize() method, 89
totalSize() method, 89
troubleshooting
databases
try/catch blocks, 65
TTL (Time To Live), 17
TTL property, 440
types
data
of replica sets, 460
of sharding servers, 469
unique property, 440
update operators, databases, 146‑147
update() method, 89, 188, 242, 254, 302, 305, 314, 371
updateExisting property, 145
updating documents, 15
upserted property, 145
upserting documents
usability, 10
use <database> command, 28
use <new_database_name> command, 92
user accounts
authentication, starting, 79
formatting, 72
user administrator accounts, formatting, 78
userAdminAnyDatabase role, 71
userAdmin role, 71
username parameter, 434
users
deleting, 77
documents, counting, 126
lists, 74
validate() method, 92
values
arrays, searching documents based on, 117
documents, searching, 118
fields
searching based on, 117
searching distinct, 138‑140, 218‑221
functions, returning, 50
key, grouping objects, 169
null variables, 39
subdocuments, searching, 118
var keyword, 38
variables
functions, passing, 50
verbose option, 179
verbose setting, 24
version() method, 87
viewing
collections, 96
databases
lists, 91
waited property, 145
while loops, 45
wnote property, 145
words, replacing strings, 58
write concerns
Node.js applications, 374
PHP applications, 257
Python applications, 317
write requests, retrieving status of database, 145
write_concern() method, 312-314
wtime property, 145
wtimeout property, 145