Compare commits
356 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
255f67a66f | ||
|
|
3d19c459fe | ||
|
|
e10d2a68be | ||
|
|
4d06e27876 | ||
|
|
9f566f7fc4 | ||
|
|
e017d55474 | ||
|
|
f65ef0b5c2 | ||
|
|
5dfc754e10 | ||
|
|
3f661319e5 | ||
|
|
90d6761433 | ||
|
|
f8294a1310 | ||
|
|
e52e4e2deb | ||
|
|
03c83b9748 | ||
|
|
3b612717c5 | ||
|
|
ac797bc824 | ||
|
|
b064102f7c | ||
|
|
778c80e455 | ||
|
|
6dc02ec1d0 | ||
|
|
5900e7a031 | ||
|
|
3f02f1a6a1 | ||
|
|
2eb48801e1 | ||
|
|
ad9df9f23b | ||
|
|
c73f7c12cd | ||
|
|
b1950f5fa7 | ||
|
|
fa7af2e2b3 | ||
|
|
8f8192fa73 | ||
|
|
6a8781ee93 | ||
|
|
6646cd2d72 | ||
|
|
c02fb34f01 | ||
|
|
9a9b2e504d | ||
|
|
03f395347f | ||
|
|
93dda51140 | ||
|
|
28f06d9343 | ||
|
|
213700b3af | ||
|
|
87fd9929f9 | ||
|
|
57bd9bd1d6 | ||
|
|
c86d218c92 | ||
|
|
81b9d6df4f | ||
|
|
7c75cf1da8 | ||
|
|
384e8e3229 | ||
|
|
812af45b31 | ||
|
|
013e21bbe5 | ||
|
|
195a67eec3 | ||
|
|
0366e4a862 | ||
|
|
0ef9bcd431 | ||
|
|
ef0072b437 | ||
|
|
f076d57d42 | ||
|
|
2cebdd054c | ||
|
|
c26b53eaf6 | ||
|
|
3fa0ec160d | ||
|
|
4649c7185d | ||
|
|
d08a911f0d | ||
|
|
8b326cb33c | ||
|
|
de14e3eed4 | ||
|
|
c2d90aad65 | ||
|
|
f791b9d401 | ||
|
|
bf471cd8e2 | ||
|
|
652d7a4c95 | ||
|
|
0661a4fa33 | ||
|
|
5f50fe901b | ||
|
|
adc534fcdd | ||
|
|
68ae4983b1 | ||
|
|
4a92104637 | ||
|
|
faaffb7477 | ||
|
|
8269033174 | ||
|
|
36a4358750 | ||
|
|
9436cd6cc5 | ||
|
|
36cd42c86d | ||
|
|
def6f6952a | ||
|
|
a07574aaa7 | ||
|
|
28bab16469 | ||
|
|
8ff445004b | ||
|
|
945ed48cc7 | ||
|
|
fef6805061 | ||
|
|
261a158b87 | ||
|
|
1e9944fbed | ||
|
|
c22fbc9bc6 | ||
|
|
ac19511d67 | ||
|
|
2ff4d735d3 | ||
|
|
71534242a3 | ||
|
|
b267b2824e | ||
|
|
71e4c210ec | ||
|
|
798f6c9a3c | ||
|
|
4b95b086d2 | ||
|
|
9568d9c60a | ||
|
|
44a476ab53 | ||
|
|
6a900b9d4f | ||
|
|
fce2652dca | ||
|
|
83460112e7 | ||
|
|
2516d36768 | ||
|
|
116d7d799a | ||
|
|
ed241301e5 | ||
|
|
a7f5949776 | ||
|
|
246bfa4e9c | ||
|
|
66da6ee14e | ||
|
|
e17c3e6dc0 | ||
|
|
14e0ba91a9 | ||
|
|
d4a70e8891 | ||
|
|
070d58c191 | ||
|
|
9ad97ac9fd | ||
|
|
d4b1e9e2e5 | ||
|
|
7303d9b39a | ||
|
|
4a3e38949a | ||
|
|
52faaa32ef | ||
|
|
e83de252ba | ||
|
|
791fcf4495 | ||
|
|
e1f859d6ae | ||
|
|
eeef3c3ded | ||
|
|
a093bfa703 | ||
|
|
8d2e6aab88 | ||
|
|
c27685781d | ||
|
|
644f645248 | ||
|
|
f70518f887 | ||
|
|
ea2102c194 | ||
|
|
c18511e8ec | ||
|
|
adbc29e06e | ||
|
|
9d7f0555fc | ||
|
|
6ea3fac317 | ||
|
|
f621320bee | ||
|
|
b39c5ee1ea | ||
|
|
f0e41e169c | ||
|
|
12279052c8 | ||
|
|
5636fd6504 | ||
|
|
1b7b02db89 | ||
|
|
a386aa6036 | ||
|
|
ccb02e83df | ||
|
|
9f1ef97401 | ||
|
|
279163e380 | ||
|
|
52da235706 | ||
|
|
b14b921ba3 | ||
|
|
be1905c24c | ||
|
|
a280cb5a78 | ||
|
|
f5544e542d | ||
|
|
758f9f60ff | ||
|
|
2af46bcef9 | ||
|
|
ac55e3f5a9 | ||
|
|
d2030ec679 | ||
|
|
1bdf9bb511 | ||
|
|
8cb4c299ca | ||
|
|
a9587732dc | ||
|
|
ba1b569cd9 | ||
|
|
6850ecf70c | ||
|
|
423ebc231a | ||
|
|
337729f2d0 | ||
|
|
ffa99f0d36 | ||
|
|
b588b9fccc | ||
|
|
1c1c76aeca | ||
|
|
8a71a071e5 | ||
|
|
bafd9c7e0e | ||
|
|
8e82f5620a | ||
|
|
4bed1574b0 | ||
|
|
65b84b79e5 | ||
|
|
91e679c210 | ||
|
|
f93d14738c | ||
|
|
c7a673410e | ||
|
|
261233b6c1 | ||
|
|
019f0ccc9e | ||
|
|
fda2dca224 | ||
|
|
2013b68ddd | ||
|
|
7ad0dc7be0 | ||
|
|
62d38e779a | ||
|
|
1d338b82d6 | ||
|
|
9b86a61a28 | ||
|
|
d2eedb1dda | ||
|
|
b3c2e5171b | ||
|
|
9d9fcde865 | ||
|
|
67ec5c5b29 | ||
|
|
7ac1d21273 | ||
|
|
1aa9b7b374 | ||
|
|
4f5e71237a | ||
|
|
6016ef6ba4 | ||
|
|
2927031d37 | ||
|
|
a12d09c975 | ||
|
|
9de22c408e | ||
|
|
eea49e2e48 | ||
|
|
ee42f85b2c | ||
|
|
7810679187 | ||
|
|
2ed3157c0c | ||
|
|
b1ee91acf6 | ||
|
|
82f2df8b93 | ||
|
|
fb2cf5e329 | ||
|
|
d0a29833d9 | ||
|
|
8af90cc7e1 | ||
|
|
f9841e0136 | ||
|
|
2f9a07b9aa | ||
|
|
a73fb4cab5 | ||
|
|
9537c9c535 | ||
|
|
ce4afbc1c2 | ||
|
|
9c93634ccc | ||
|
|
0c1fa12980 | ||
|
|
0d2fe93ded | ||
|
|
f81b9676fa | ||
|
|
1b9917b39c | ||
|
|
2005e174be | ||
|
|
dcabd35e33 | ||
|
|
7f6bf41fee | ||
|
|
1b7fe7694c | ||
|
|
3ca3effff3 | ||
|
|
f2e8a05f84 | ||
|
|
1cfdc9f9e8 | ||
|
|
32514385e1 | ||
|
|
2b63155333 | ||
|
|
9298aabe18 | ||
|
|
feaac6b426 | ||
|
|
dbb698b61a | ||
|
|
b48e15efdd | ||
|
|
70f7743138 | ||
|
|
4d24c0155e | ||
|
|
4692aaec6e | ||
|
|
020e64123f | ||
|
|
2f3c2123ac | ||
|
|
e6f210813e | ||
|
|
09ab197844 | ||
|
|
d061fb5f99 | ||
|
|
4201130bb0 | ||
|
|
8bb2e09856 | ||
|
|
1e1d57093a | ||
|
|
5047fba16c | ||
|
|
df37f6c684 | ||
|
|
39b2a80cf0 | ||
|
|
af443fd3e7 | ||
|
|
9e94da3867 | ||
|
|
98e464bc2a | ||
|
|
7595193acb | ||
|
|
6d3cacf2bd | ||
|
|
376a9b2836 | ||
|
|
2998dbfb20 | ||
|
|
63a0c2647e | ||
|
|
30fe38c527 | ||
|
|
b90627fb98 | ||
|
|
007615e159 | ||
|
|
51cd272bb6 | ||
|
|
8f5d4b3afe | ||
|
|
7444a98bef | ||
|
|
2c324c51b0 | ||
|
|
1502899e7f | ||
|
|
10c2badf2e | ||
|
|
174f9bea00 | ||
|
|
886e1c281d | ||
|
|
df1e0d4ab0 | ||
|
|
f77427bddf | ||
|
|
112c32c0fd | ||
|
|
1751a13cc6 | ||
|
|
258d46ecee | ||
|
|
96d25f6e30 | ||
|
|
0820546eef | ||
|
|
444bb62c24 | ||
|
|
602cc638b3 | ||
|
|
d44539de67 | ||
|
|
d2716598fc | ||
|
|
0966b812bd | ||
|
|
52a9e923df | ||
|
|
76f298f24e | ||
|
|
092deb7463 | ||
|
|
1b6ec9b660 | ||
|
|
586200c20f | ||
|
|
8ff2e19762 | ||
|
|
69ec3ce065 | ||
|
|
06af0c0546 | ||
|
|
8b99b7e8b7 | ||
|
|
50a0399775 | ||
|
|
b9da5eed52 | ||
|
|
4b1e555f6b | ||
|
|
6b5e42ed2f | ||
|
|
c19b54dd42 | ||
|
|
d3b45e4327 | ||
|
|
2b2cf4a9b4 | ||
|
|
1c5e4d72d2 | ||
|
|
670a13d965 | ||
|
|
f5623ce7ed | ||
|
|
21426b3b81 | ||
|
|
11e8a1d1b7 | ||
|
|
2758187dd4 | ||
|
|
d465ba1e2e | ||
|
|
b4a5812a05 | ||
|
|
5a1f1f2866 | ||
|
|
0147b057c2 | ||
|
|
8492832436 | ||
|
|
99cd103ecf | ||
|
|
286b6ba87e | ||
|
|
094f1565d6 | ||
|
|
b92555698f | ||
|
|
05bd38351d | ||
|
|
05aa222eb5 | ||
|
|
36c6964edd | ||
|
|
7497c50db0 | ||
|
|
72e9bea86f | ||
|
|
3e62600166 | ||
|
|
dd73cdcea6 | ||
|
|
43be3d5a87 | ||
|
|
510e2dda4e | ||
|
|
5fd8754e9b | ||
|
|
c5f6e32f2b | ||
|
|
dfe3e9aaa5 | ||
|
|
8034a8d6a1 | ||
|
|
f0cc6f2fdb | ||
|
|
975cff4802 | ||
|
|
0de6511419 | ||
|
|
63861f53c4 | ||
|
|
d1e423807a | ||
|
|
7226cdfa51 | ||
|
|
77fb13bbce | ||
|
|
5109563d5e | ||
|
|
0838167a27 | ||
|
|
e08a0f09d0 | ||
|
|
224c373b84 | ||
|
|
f72cfb449a | ||
|
|
3603a62092 | ||
|
|
c17ce85e7b | ||
|
|
c78bdafae3 | ||
|
|
7e2f84ae56 | ||
|
|
8d3be24f17 | ||
|
|
3e88add23c | ||
|
|
3319a45ff5 | ||
|
|
9f437614f4 | ||
|
|
1c177bb5d9 | ||
|
|
0de7cca4a1 | ||
|
|
9c6fcdd277 | ||
|
|
ff6d29cbf6 | ||
|
|
41f534dc96 | ||
|
|
b5e634f883 | ||
|
|
0dab427a05 | ||
|
|
dc11b6e852 | ||
|
|
c81d07b9b2 | ||
|
|
78f486cdc7 | ||
|
|
d2e6240d6b | ||
|
|
d2f973185d | ||
|
|
34559b85ba | ||
|
|
3550104638 | ||
|
|
8cc495d5e0 | ||
|
|
c6dad5a441 | ||
|
|
a4ad235adc | ||
|
|
8c92b5ae58 | ||
|
|
3b7aae27fe | ||
|
|
ad04c8caf4 | ||
|
|
0716e47f14 | ||
|
|
88d3c3f494 | ||
|
|
5bd9fa125c | ||
|
|
a53a7eec05 | ||
|
|
d878b59856 | ||
|
|
3956365fcc | ||
|
|
858f12a88f | ||
|
|
d1fa029106 | ||
|
|
a5802c94f1 | ||
|
|
4cde62902c | ||
|
|
09acefaf1e | ||
|
|
32085c5e4a | ||
|
|
f4d08212ef | ||
|
|
4233257f59 | ||
|
|
fa53389976 | ||
|
|
dad98f8d0e | ||
|
|
d66bf3e0a6 | ||
|
|
c59b877cb9 | ||
|
|
8043d3465f | ||
|
|
45f2cf47ea | ||
|
|
e972301dfc |
@ -76,6 +76,7 @@ addSmokeSuite( "smokeModuleTests", "$MODULETEST_LIST" )
|
||||
# These tests require the mongo shell
|
||||
if shellEnv is not None:
|
||||
addSmoketest( "smokeJs", [add_exe("mongo"), add_exe("mongod")] )
|
||||
addSmoketest( "smokeJsCore", [add_exe("mongo"), add_exe("mongod")] )
|
||||
addSmoketest( "smokeClone", [ add_exe("mongo"), add_exe("mongod") ] )
|
||||
addSmoketest( "smokeRepl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
||||
addSmoketest( "smokeReplSets", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
||||
@ -85,8 +86,10 @@ if shellEnv is not None:
|
||||
addSmoketest( "smokeParallel", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
|
||||
addSmoketest( "smokeSharding", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos"), add_exe('mongofiles') ] )
|
||||
addSmoketest( "smokeJsPerf", [ add_exe("mongo"), add_exe("mongod") ] )
|
||||
addSmoketest( "smokeJsSlowNightly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeJsSlowWeekly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeNoPassthroughWithMongod", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeNoPassthrough", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeSlow1", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeSlow2", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
||||
addSmoketest( "smokeQuota", [ add_exe("mongo"), add_exe("mongod") ] )
|
||||
addSmoketest( "smokeTool", [ add_exe( "mongo" ), add_exe("mongod"), add_exe("mongos"), "tools" ] )
|
||||
addSmoketest( "smokeAggregation", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
||||
|
||||
@ -299,6 +299,8 @@ add_option("mongod-concurrency-level", "Concurrency level, \"global\" or \"db\""
|
||||
|
||||
add_option('build-fast-and-loose', "NEVER for production builds", 0, False)
|
||||
|
||||
add_option('disable-warnings-as-errors', "Don't add -Werror to compiler command line", 0, False)
|
||||
|
||||
add_option('propagate-shell-environment',
|
||||
"Pass shell environment to sub-processes (NEVER for production builds)",
|
||||
0, False)
|
||||
@ -819,7 +821,9 @@ if nix:
|
||||
"-Winvalid-pch"] )
|
||||
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
|
||||
if linux or darwin:
|
||||
env.Append( CCFLAGS=["-Werror", "-pipe"] )
|
||||
env.Append( CCFLAGS=["-pipe"] )
|
||||
if not has_option("disable-warnings-as-errors"):
|
||||
env.Append( CCFLAGS=["-Werror"] )
|
||||
|
||||
env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
|
||||
env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
|
||||
|
||||
@ -5,7 +5,6 @@ import sys
|
||||
import os, os.path
|
||||
import utils
|
||||
import time
|
||||
import exceptions
|
||||
from optparse import OptionParser
|
||||
|
||||
def shouldKill( c, root=None ):
|
||||
@ -61,6 +60,22 @@ def killprocs( signal="", root=None ):
|
||||
return killed
|
||||
|
||||
|
||||
def tryToRemove(path):
|
||||
for _ in range(60):
|
||||
try:
|
||||
os.remove(path)
|
||||
return True
|
||||
except OSError, e:
|
||||
errno = getattr(e, 'winerror', None)
|
||||
# check for the access denied and file in use WindowsErrors
|
||||
if errno in (5, 32):
|
||||
print("os.remove(%s) failed, retrying in one second." % path)
|
||||
time.sleep(1)
|
||||
else:
|
||||
raise e
|
||||
return False
|
||||
|
||||
|
||||
def cleanup( root , nokill ):
|
||||
if nokill:
|
||||
print "nokill requested, not killing anybody"
|
||||
@ -74,16 +89,9 @@ def cleanup( root , nokill ):
|
||||
for ( dirpath , dirnames , filenames ) in os.walk( root , topdown=False ):
|
||||
for x in filenames:
|
||||
foo = dirpath + "/" + x
|
||||
print( "removing: " + foo )
|
||||
try:
|
||||
os.remove(foo)
|
||||
except exceptions.OSError, e:
|
||||
# SERVER-10462 compensate for Windows file locking race
|
||||
# We want to catch WindowsError but can't use that name on other platforms
|
||||
print(repr(e))
|
||||
print("os.remove(%s) failed, retrying once." % foo)
|
||||
time.sleep(1)
|
||||
os.remove(foo)
|
||||
if os.path.exists(foo):
|
||||
if not tryToRemove(foo):
|
||||
raise Exception("Couldn't remove file '%s' after 60 seconds" % foo)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = OptionParser(usage="read the script")
|
||||
|
||||
@ -29,17 +29,89 @@ For a detailed usage example, see src/SConscript.client or src/mongo/SConscript.
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import zipfile
|
||||
from subprocess import (Popen, PIPE, STDOUT)
|
||||
|
||||
def main(argv):
|
||||
opts = parse_options(argv[1:])
|
||||
archive = open_archive_for_write(opts.output_filename, opts.archive_format)
|
||||
if opts.archive_format in ('tar', 'tgz'):
|
||||
make_tar_archive(opts)
|
||||
elif opts.archive_format in ('zip'):
|
||||
make_zip_archive(opts)
|
||||
else:
|
||||
raise ValueError('Unsupported archive format "%s"' % opts.archive_format)
|
||||
|
||||
def delete_directory(dir):
|
||||
'''Recursively deletes a directory and its contents.
|
||||
'''
|
||||
try:
|
||||
shutil.rmtree(dir)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def make_tar_archive(opts):
|
||||
'''Given the parsed options, generates the 'opt.output_filename'
|
||||
tarball containing all the files in 'opt.input_filename' renamed
|
||||
according to the mappings in 'opts.transformations'.
|
||||
|
||||
e.g. for an input file named "a/mongo/build/DISTSRC", and an
|
||||
existing transformation {"a/mongo/build": "release"}, the input
|
||||
file will be written to the tarball as "release/DISTSRC"
|
||||
|
||||
All files to be compressed are copied into new directories as
|
||||
required by 'opts.transformations'. Once the tarball has been
|
||||
created, all temporary directory structures created for the
|
||||
purposes of compressing, are removed.
|
||||
'''
|
||||
tar_options = "cvf"
|
||||
if opts.archive_format is 'tgz':
|
||||
tar_options += "z"
|
||||
|
||||
# clean and create a temp directory to copy files to
|
||||
enclosing_archive_directory = os.path.join("build", "archive")
|
||||
delete_directory(enclosing_archive_directory)
|
||||
os.makedirs(enclosing_archive_directory)
|
||||
output_tarfile = os.path.join(os.getcwd(), opts.output_filename)
|
||||
|
||||
tar_command = ["tar", tar_options, output_tarfile]
|
||||
|
||||
for input_filename in opts.input_filenames:
|
||||
preferred_filename = get_preferred_filename(input_filename, opts.transformations)
|
||||
temp_file_location = os.path.join(enclosing_archive_directory, preferred_filename)
|
||||
enclosing_file_directory = os.path.dirname(temp_file_location)
|
||||
if not os.path.exists(enclosing_file_directory):
|
||||
os.makedirs(enclosing_file_directory)
|
||||
print "copying %s => %s" % (input_filename, temp_file_location)
|
||||
shutil.copy2(input_filename, temp_file_location)
|
||||
tar_command.append(preferred_filename)
|
||||
|
||||
print " ".join(tar_command)
|
||||
# execute the full tar command
|
||||
run_directory = os.path.join(os.getcwd(), enclosing_archive_directory)
|
||||
proc = Popen(tar_command, stdout=PIPE, stderr=STDOUT, bufsize=0, cwd=run_directory)
|
||||
proc.wait()
|
||||
|
||||
# delete temp directory
|
||||
delete_directory(enclosing_archive_directory)
|
||||
|
||||
def make_zip_archive(opts):
|
||||
'''Given the parsed options, generates the 'opt.output_filename'
|
||||
zipfile containing all the files in 'opt.input_filename' renamed
|
||||
according to the mappings in 'opts.transformations'.
|
||||
|
||||
All files in 'opt.output_filename' are renamed before being
|
||||
written into the zipfile.
|
||||
'''
|
||||
archive = open_zip_archive_for_write(opts.output_filename)
|
||||
try:
|
||||
for input_filename in opts.input_filenames:
|
||||
archive.add(input_filename, arcname=get_preferred_filename(input_filename,
|
||||
opts.transformations))
|
||||
opts.transformations))
|
||||
finally:
|
||||
archive.close()
|
||||
|
||||
|
||||
def parse_options(args):
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-o', dest='output_filename', default=None,
|
||||
@ -82,30 +154,21 @@ def parse_options(args):
|
||||
|
||||
return opts
|
||||
|
||||
def open_archive_for_write(filename, archive_format):
|
||||
'''Open a tar or zip archive for write, with the given format, and return it.
|
||||
|
||||
The type of archive is determined by the "archive_format" parameter, which should be
|
||||
"tar", "tgz" (for gzipped tar) or "zip".
|
||||
def open_zip_archive_for_write(filename):
|
||||
'''Open a zip archive for writing and return it.
|
||||
'''
|
||||
|
||||
if archive_format in ('tar', 'tgz'):
|
||||
import tarfile
|
||||
mode = 'w'
|
||||
if archive_format is 'tgz':
|
||||
mode += '|gz'
|
||||
return tarfile.open(filename, mode)
|
||||
if archive_format is 'zip':
|
||||
import zipfile
|
||||
# Infuriatingly, Zipfile calls the "add" method "write", but they're otherwise identical,
|
||||
# for our purposes. WrappedZipFile is a minimal adapter class.
|
||||
class WrappedZipFile(zipfile.ZipFile):
|
||||
def add(self, filename, arcname):
|
||||
return self.write(filename, arcname)
|
||||
return WrappedZipFile(filename, 'w', zipfile.ZIP_DEFLATED)
|
||||
raise ValueError('Unsupported archive format "%s"' % archive_format)
|
||||
# Infuriatingly, Zipfile calls the "add" method "write", but they're otherwise identical,
|
||||
# for our purposes. WrappedZipFile is a minimal adapter class.
|
||||
class WrappedZipFile(zipfile.ZipFile):
|
||||
def add(self, filename, arcname):
|
||||
return self.write(filename, arcname)
|
||||
return WrappedZipFile(filename, 'w', zipfile.ZIP_DEFLATED)
|
||||
|
||||
def get_preferred_filename(input_filename, transformations):
|
||||
'''Does a prefix subsitution on 'input_filename' for the
|
||||
first matching transformation in 'transformations' and
|
||||
returns the substituted string
|
||||
'''
|
||||
for match, replace in transformations:
|
||||
if input_filename.startswith(match):
|
||||
return replace + input_filename[len(match):]
|
||||
|
||||
@ -17,6 +17,28 @@ import gzip
|
||||
# Only really tested/works on Linux.
|
||||
#
|
||||
|
||||
def version_tuple(version):
|
||||
"""Returns a version tuple that can be used for numeric sorting
|
||||
of version strings such as '2.6.0-rc1' and '2.4.0'"""
|
||||
|
||||
RC_OFFSET = -100
|
||||
version_parts = re.split(r'\.|-', version[0])
|
||||
|
||||
if version_parts[-1].startswith("rc"):
|
||||
rc_part = version_parts.pop()
|
||||
rc_part = rc_part.split('rc')[1]
|
||||
|
||||
# RC versions are weighted down to allow future RCs and general
|
||||
# releases to be sorted in ascending order (e.g., 2.6.0-rc1,
|
||||
# 2.6.0-rc2, 2.6.0).
|
||||
version_parts.append(int(rc_part) + RC_OFFSET)
|
||||
else:
|
||||
# Non-RC releases have an extra 0 appended so version tuples like
|
||||
# (2, 6, 0, -100) and (2, 6, 0, 0) sort in ascending order.
|
||||
version_parts.append(0)
|
||||
|
||||
return tuple(map(int, version_parts))
|
||||
|
||||
class MultiVersionDownloader :
|
||||
|
||||
def __init__(self, install_dir, link_dir, platform):
|
||||
@ -25,7 +47,13 @@ class MultiVersionDownloader :
|
||||
match = re.compile("(.*)\/(.*)").match(platform)
|
||||
self.platform = match.group(1)
|
||||
self.arch = match.group(2)
|
||||
self.links = self.download_links()
|
||||
self._links = None
|
||||
|
||||
@property
|
||||
def links(self):
|
||||
if self._links is None:
|
||||
self._links = self.download_links()
|
||||
return self._links
|
||||
|
||||
def download_links(self):
|
||||
href = "http://dl.mongodb.org/dl/%s/%s" \
|
||||
@ -70,7 +98,7 @@ class MultiVersionDownloader :
|
||||
raise Exception("Cannot find a link for version %s, versions %s found." \
|
||||
% (version, self.links))
|
||||
|
||||
urls.sort()
|
||||
urls.sort(key=version_tuple)
|
||||
full_version = urls[-1][0]
|
||||
url = urls[-1][1]
|
||||
extract_dir = url.split("/")[-1][:-4]
|
||||
|
||||
@ -38,23 +38,19 @@ from itertools import izip
|
||||
import glob
|
||||
from optparse import OptionParser
|
||||
import os
|
||||
import parser
|
||||
import pprint
|
||||
import re
|
||||
import shutil
|
||||
import shlex
|
||||
import socket
|
||||
import stat
|
||||
from subprocess import (Popen,
|
||||
PIPE,
|
||||
STDOUT,
|
||||
call)
|
||||
from subprocess import (PIPE, Popen, STDOUT)
|
||||
import sys
|
||||
import time
|
||||
|
||||
from pymongo import Connection
|
||||
from pymongo.errors import OperationFailure
|
||||
|
||||
import cleanbb
|
||||
import utils
|
||||
|
||||
try:
|
||||
@ -87,6 +83,8 @@ continue_on_failure = None
|
||||
file_of_commands_mode = False
|
||||
start_mongod = True
|
||||
temp_path = None
|
||||
clean_every_n_tests = 1
|
||||
clean_whole_dbroot = False
|
||||
|
||||
tests = []
|
||||
winners = []
|
||||
@ -126,6 +124,16 @@ def buildlogger(cmd, is_global=False):
|
||||
return [utils.find_python(), 'buildscripts/buildlogger.py'] + cmd
|
||||
return cmd
|
||||
|
||||
|
||||
def clean_dbroot(dbroot="", nokill=False):
|
||||
# Clean entire /data/db dir if --with-cleanbb, else clean specific database path.
|
||||
if clean_whole_dbroot and not small_oplog:
|
||||
dbroot = os.path.normpath(smoke_db_prefix + "/data/db")
|
||||
if os.path.exists(dbroot):
|
||||
print("clean_dbroot: %s" % dbroot)
|
||||
cleanbb.cleanup(dbroot, nokill)
|
||||
|
||||
|
||||
class mongod(object):
|
||||
def __init__(self, **kwargs):
|
||||
self.kwargs = kwargs
|
||||
@ -189,13 +197,10 @@ class mongod(object):
|
||||
srcport = mongod_port
|
||||
self.port += 1
|
||||
self.slave = True
|
||||
if os.path.exists(dir_name):
|
||||
if 'slave' in self.kwargs:
|
||||
argv = [utils.find_python(), "buildscripts/cleanbb.py", '--nokill', dir_name]
|
||||
else:
|
||||
argv = [utils.find_python(), "buildscripts/cleanbb.py", dir_name]
|
||||
call(argv)
|
||||
|
||||
clean_dbroot(dbroot=dir_name, nokill=self.slave)
|
||||
utils.ensureDir(dir_name)
|
||||
|
||||
argv = [mongod_executable, "--port", str(self.port), "--dbpath", dir_name]
|
||||
# These parameters are alwas set for tests
|
||||
# SERVER-9137 Added httpinterface parameter to keep previous behavior
|
||||
@ -347,7 +352,7 @@ def check_db_hashes(master, slave):
|
||||
replicated_collections += master.dict.keys()
|
||||
|
||||
for coll in replicated_collections:
|
||||
if coll not in slave.dict:
|
||||
if coll not in slave.dict and coll not in lost_in_slave:
|
||||
lost_in_slave.append(coll)
|
||||
mhash = master.dict[coll]
|
||||
shash = slave.dict[coll]
|
||||
@ -383,7 +388,7 @@ def check_db_hashes(master, slave):
|
||||
|
||||
|
||||
for db in slave.dict.keys():
|
||||
if db not in master.dict:
|
||||
if db not in master.dict and db not in lost_in_master:
|
||||
lost_in_master.append(db)
|
||||
|
||||
|
||||
@ -392,14 +397,14 @@ def ternary( b , l="true", r="false" ):
|
||||
return l
|
||||
return r
|
||||
|
||||
|
||||
# Blech.
|
||||
def skipTest(path):
|
||||
basename = os.path.basename(path)
|
||||
parentPath = os.path.dirname(path)
|
||||
parentDir = os.path.basename(parentPath)
|
||||
if small_oplog: # For tests running in parallel
|
||||
if basename in ["cursor8.js", "indexh.js", "dropdb.js", "connections_opened.js", "opcounters.js", "dbadmin.js"]:
|
||||
if basename in ["cursor8.js", "indexh.js", "dropdb.js", "dropdb_race.js",
|
||||
"connections_opened.js", "opcounters.js", "dbadmin.js"]:
|
||||
return True
|
||||
if use_ssl:
|
||||
# Skip tests using mongobridge since it does not support SSL
|
||||
@ -426,7 +431,6 @@ def skipTest(path):
|
||||
|
||||
authTestsToSkip = [("jstests", "drop2.js"), # SERVER-8589,
|
||||
("jstests", "killop.js"), # SERVER-10128
|
||||
("sharding", "trace_missing_docs_test.js"), # SERVER-10640
|
||||
("sharding", "sync3.js"), # SERVER-6388 for this and those below
|
||||
("sharding", "sync6.js"),
|
||||
("sharding", "parallel.js"),
|
||||
@ -443,6 +447,16 @@ def skipTest(path):
|
||||
|
||||
return False
|
||||
|
||||
forceCommandsForDirs = ["aggregation", "auth", "core", "parallel", "replsets"]
|
||||
# look for jstests and one of the above suites separated by either posix or windows slashes
|
||||
forceCommandsRE = re.compile(r"jstests[/\\](%s)" % ('|'.join(forceCommandsForDirs)))
|
||||
def setShellWriteModeForTest(path, argv):
|
||||
swm = shell_write_mode
|
||||
if swm == "legacy": # change when the default changes to "commands"
|
||||
if use_write_commands or forceCommandsRE.search(path):
|
||||
swm = "commands"
|
||||
argv += ["--writeMode", swm]
|
||||
|
||||
def runTest(test, result):
|
||||
# result is a map containing test result details, like result["url"]
|
||||
|
||||
@ -469,10 +483,9 @@ def runTest(test, result):
|
||||
path = argv[1]
|
||||
elif ext == ".js":
|
||||
argv = [shell_executable, "--port", mongod_port, '--authenticationMechanism', authMechanism]
|
||||
if use_write_commands:
|
||||
argv += ["--writeMode", "commands"]
|
||||
else:
|
||||
argv += ["--writeMode", shell_write_mode]
|
||||
|
||||
setShellWriteModeForTest(path, argv)
|
||||
|
||||
if not usedb:
|
||||
argv += ["--nodb"]
|
||||
if small_oplog or small_oplog_rs:
|
||||
@ -525,8 +538,7 @@ def runTest(test, result):
|
||||
'TestData.authMechanism = ' + ternary( authMechanism,
|
||||
'"' + str(authMechanism) + '"', 'null') + ";" + \
|
||||
'TestData.useSSL = ' + ternary( use_ssl ) + ";" + \
|
||||
'TestData.useX509 = ' + ternary( use_x509 ) + ";" + \
|
||||
'TestData.useWriteCommands = ' + ternary( use_write_commands ) + ";"
|
||||
'TestData.useX509 = ' + ternary( use_x509 ) + ";"
|
||||
# this updates the default data directory for mongod processes started through shell (src/mongo/shell/servers.js)
|
||||
evalString += 'MongoRunner.dataDir = "' + os.path.abspath(smoke_db_prefix + '/data/db') + '";'
|
||||
evalString += 'MongoRunner.dataPath = MongoRunner.dataDir + "/";'
|
||||
@ -665,8 +677,8 @@ def run_tests(tests):
|
||||
if small_oplog or small_oplog_rs:
|
||||
master.wait_for_repl()
|
||||
|
||||
tests_run = 0
|
||||
for tests_run, test in enumerate(tests):
|
||||
tests_run += 1 # enumerate from 1, python 2.5 compatible
|
||||
test_result = { "start": time.time() }
|
||||
|
||||
(test_path, use_db) = test
|
||||
@ -701,8 +713,9 @@ def run_tests(tests):
|
||||
check_and_report_replication_dbhashes()
|
||||
|
||||
elif use_db: # reach inside test and see if "usedb" is true
|
||||
if (tests_run+1) % 20 == 0:
|
||||
# restart mongo every 20 times, for our 32-bit machines
|
||||
if clean_every_n_tests and (tests_run % clean_every_n_tests) == 0:
|
||||
# Restart mongod periodically to clean accumulated test data
|
||||
# clean_dbroot() is invoked by mongod.start()
|
||||
master.__exit__(None, None, None)
|
||||
master = mongod(small_oplog_rs=small_oplog_rs,
|
||||
small_oplog=small_oplog,
|
||||
@ -755,7 +768,10 @@ at the end of testing:""" % (src, dst)
|
||||
at the end of testing:"""
|
||||
for coll in screwy_in_slave.keys():
|
||||
stats = screwy_in_slave[coll]
|
||||
print "collection: %s\t (master/slave) hashes: %s/%s counts: %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave'])
|
||||
# Counts are "approx" because they are collected after the dbhash runs and may not
|
||||
# reflect the states of the collections that were hashed. If the hashes differ, one
|
||||
# possibility is that a test exited with writes still in-flight.
|
||||
print "collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave'])
|
||||
if "docs" in stats:
|
||||
if (("master" in stats["docs"] and len(stats["docs"]["master"]) != 0) or
|
||||
("slave" in stats["docs"] and len(stats["docs"]["slave"]) != 0)):
|
||||
@ -806,12 +822,12 @@ def report():
|
||||
|
||||
# Keys are the suite names (passed on the command line to smoke.py)
|
||||
# Values are pairs: (filenames, <start mongod before running tests>)
|
||||
suiteGlobalConfig = {"js": ("[!_]*.js", True),
|
||||
suiteGlobalConfig = {"js": ("core/*.js", True),
|
||||
"quota": ("quota/*.js", True),
|
||||
"jsPerf": ("perf/*.js", True),
|
||||
"disk": ("disk/*.js", True),
|
||||
"jsSlowNightly": ("slowNightly/*.js", True),
|
||||
"jsSlowWeekly": ("slowWeekly/*.js", False),
|
||||
"noPassthroughWithMongod": ("noPassthroughWithMongod/*.js", True),
|
||||
"noPassthrough": ("noPassthrough/*.js", False),
|
||||
"parallel": ("parallel/*.js", True),
|
||||
"clone": ("clone/*.js", False),
|
||||
"repl": ("repl/*.js", False),
|
||||
@ -825,8 +841,10 @@ suiteGlobalConfig = {"js": ("[!_]*.js", True),
|
||||
"failPoint": ("fail_point/*.js", False),
|
||||
"ssl": ("ssl/*.js", True),
|
||||
"sslSpecial": ("sslSpecial/*.js", True),
|
||||
"jsCore": ("core/[!_]*.js", True),
|
||||
"jsCore": ("core/*.js", True),
|
||||
"gle": ("gle/*.js", True),
|
||||
"slow1": ("slow1/*.js", True),
|
||||
"slow2": ("slow2/*.js", True),
|
||||
}
|
||||
|
||||
def get_module_suites():
|
||||
@ -888,7 +906,21 @@ def expand_suites(suites,expandUseDB=True):
|
||||
module_suites = get_module_suites()
|
||||
for suite in suites:
|
||||
if suite == 'all':
|
||||
return expand_suites(['test', 'perf', 'js', 'jsPerf', 'jsSlowNightly', 'jsSlowWeekly', 'clone', 'parallel', 'repl', 'auth', 'sharding', 'tool'],expandUseDB=expandUseDB)
|
||||
return expand_suites(['test',
|
||||
'perf',
|
||||
'jsCore',
|
||||
'jsPerf',
|
||||
'noPassthroughWithMongod',
|
||||
'noPassthrough',
|
||||
'clone',
|
||||
'parallel',
|
||||
'repl',
|
||||
'auth',
|
||||
'sharding',
|
||||
'slow1',
|
||||
'slow2',
|
||||
'tool'],
|
||||
expandUseDB=expandUseDB)
|
||||
if suite == 'test':
|
||||
if os.sys.platform == "win32":
|
||||
program = 'test.exe'
|
||||
@ -949,12 +981,17 @@ def add_exe(e):
|
||||
return e
|
||||
|
||||
def set_globals(options, tests):
|
||||
global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog, small_oplog_rs
|
||||
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, auth, authMechanism, keyFile, keyFileData, smoke_db_prefix, test_path, start_mongod
|
||||
global mongod_executable, mongod_port, shell_executable, continue_on_failure
|
||||
global small_oplog, small_oplog_rs
|
||||
global no_journal, set_parameters, set_parameters_mongos, no_preallocj
|
||||
global auth, authMechanism, keyFile, keyFileData, smoke_db_prefix, test_path, start_mongod
|
||||
global use_ssl, use_x509
|
||||
global file_of_commands_mode
|
||||
global report_file, shell_write_mode, use_write_commands
|
||||
global temp_path
|
||||
global clean_every_n_tests
|
||||
global clean_whole_dbroot
|
||||
|
||||
start_mongod = options.start_mongod
|
||||
if hasattr(options, 'use_ssl'):
|
||||
use_ssl = options.use_ssl
|
||||
@ -987,6 +1024,9 @@ def set_globals(options, tests):
|
||||
authMechanism = options.authMechanism
|
||||
keyFile = options.keyFile
|
||||
|
||||
clean_every_n_tests = options.clean_every_n_tests
|
||||
clean_whole_dbroot = options.with_cleanbb
|
||||
|
||||
if auth and not keyFile:
|
||||
# if only --auth was given to smoke.py, load the
|
||||
# default keyFile from jstests/libs/authTestsKey
|
||||
@ -1091,8 +1131,8 @@ def add_to_failfile(tests, options):
|
||||
|
||||
def main():
|
||||
global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog
|
||||
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, auth, keyFile, smoke_db_prefix, test_path
|
||||
global use_write_commands
|
||||
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, auth
|
||||
global keyFile, smoke_db_prefix, test_path, use_write_commands
|
||||
|
||||
parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
|
||||
parser.add_option('--mode', dest='mode', default='suite',
|
||||
@ -1146,9 +1186,12 @@ def main():
|
||||
parser.add_option('--reset-old-fails', dest='reset_old_fails', default=False,
|
||||
action="store_true",
|
||||
help='Clear the failfile. Do this if all tests pass')
|
||||
parser.add_option('--with-cleanbb', dest='with_cleanbb', default=False,
|
||||
action="store_true",
|
||||
help='Clear database files from previous smoke.py runs')
|
||||
parser.add_option('--with-cleanbb', dest='with_cleanbb', action="store_true",
|
||||
default=False,
|
||||
help='Clear database files before first test')
|
||||
parser.add_option('--clean-every', dest='clean_every_n_tests', type='int',
|
||||
default=20,
|
||||
help='Clear database files every N tests [default %default]')
|
||||
parser.add_option('--dont-start-mongod', dest='start_mongod', default=True,
|
||||
action='store_false',
|
||||
help='Do not start mongod before commencing test running')
|
||||
@ -1240,8 +1283,7 @@ def main():
|
||||
return
|
||||
|
||||
if options.with_cleanbb:
|
||||
dbroot = os.path.join(options.smoke_db_prefix, 'data', 'db')
|
||||
call([utils.find_python(), "buildscripts/cleanbb.py", "--nokill", dbroot])
|
||||
clean_dbroot(nokill=True)
|
||||
|
||||
test_report["start"] = time.time()
|
||||
test_report["mongod_running_at_start"] = mongod().is_mongod_up(mongod_port)
|
||||
|
||||
65
debian/bsondump.1
vendored
65
debian/bsondump.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "BSONDUMP" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "BSONDUMP" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
bsondump \- MongoDB BSON utility
|
||||
bsondump \- MongoDB BSON Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -54,30 +54,45 @@ BSON files, not a tool for data ingestion or other application use.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBbsondump\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBbsondump\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBbsondump\fP utility.
|
||||
Returns the \fBbsondump\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-objcheck
|
||||
Validates each \fIBSON\fP object before outputting it in
|
||||
\fIJSON\fP format. By default, \fBbsondump\fP enables
|
||||
\fI\-\-objcheck\fP\&. For objects with a high degree of
|
||||
sub\-document nesting, \fI\-\-objcheck\fP can have a small impact
|
||||
on performance. You can set \fI\-\-noobjcheck\fP to disable
|
||||
object checking.
|
||||
Validates each \fIBSON\fP object before outputting it in \fIJSON\fP
|
||||
format. By default, \fBbsondump\fP enables \fI\-\-objcheck\fP\&.
|
||||
For objects with a high degree of sub\-document nesting,
|
||||
\fI\-\-objcheck\fP can have a small impact on performance. You can set
|
||||
\fI\-\-noobjcheck\fP to disable object checking.
|
||||
.sp
|
||||
Changed in version 2.4: MongoDB enables \fI\-\-objcheck\fP by default, to prevent any
|
||||
client from inserting malformed or invalid BSON into a MongoDB
|
||||
@ -90,31 +105,31 @@ database.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Disables the default document validation that \fBbsondump\fP
|
||||
performs on all BSON documents.
|
||||
Disables the default document validation that MongoDB performs on all
|
||||
incoming BSON documents.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-filter \(aq<JSON>\(aq
|
||||
.B \-\-filter <JSON>
|
||||
Limits the documents that \fBbsondump\fP exports to only those
|
||||
documents that match the \fIJSON document\fP specified as
|
||||
\fB\(aq<JSON>\(aq\fP\&. Be sure to include the document in single quotes to
|
||||
avoid interaction with your system\(aqs shell environment.
|
||||
\fB\(aq<JSON>\(aq\fP\&. Be sure to include the document in single quotes to avoid
|
||||
interaction with your system\(aqs shell environment.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-type <=json|=debug>
|
||||
Changes the operation of \fBbsondump\fP from outputting "\fIJSON\fP" (the
|
||||
default) to a debugging format.
|
||||
Changes the operation of \fBbsondump\fP from outputting
|
||||
"\fIJSON\fP" (the default) to a debugging format.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B <bsonfilename>
|
||||
.B <bsonFilename>
|
||||
The final argument to \fBbsondump\fP is a document containing
|
||||
\fIBSON\fP\&. This data is typically generated by
|
||||
\fBmongodump\fP or by MongoDB in a \fIrollback\fP operation.
|
||||
\fBbsondump\fP or by MongoDB in a \fIrollback\fP operation.
|
||||
.UNINDENT
|
||||
.SH USAGE
|
||||
.SH USE
|
||||
.sp
|
||||
By default, \fBbsondump\fP outputs data to standard output. To
|
||||
create corresponding \fIJSON\fP files, you will need to use the
|
||||
@ -145,6 +160,6 @@ bsondump \-\-type=debug collection.bson
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
403
debian/mongo.1
vendored
403
debian/mongo.1
vendored
@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGO" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGO" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongo \- MongoDB Shell
|
||||
.
|
||||
@ -39,8 +39,8 @@ operations directly with the database. \fBmongo\fP also provides
|
||||
a fully functional JavaScript environment for use with a MongoDB. This
|
||||
document addresses the basic invocation of the \fBmongo\fP shell
|
||||
and an overview of its usage.
|
||||
.SH INTERFACE
|
||||
.SS Options
|
||||
.SH OPTIONS
|
||||
.SS Core Options
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B mongo
|
||||
@ -48,25 +48,23 @@ and an overview of its usage.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-shell
|
||||
Enables the shell interface after evaluating a \fIJavaScript\fP file.
|
||||
If you invoke the \fBmongo\fP command and specify a JavaScript
|
||||
file as an argument, or use \fI\%--eval\fP to specify
|
||||
JavaScript on the command line, the \fI\%--shell\fP option
|
||||
provides the user with a shell prompt after the file finishes
|
||||
executing.
|
||||
Enables the shell interface. If you invoke the \fBmongo\fP command
|
||||
and specify a JavaScript file as an argument, or use \fI\%\-\-eval\fP to
|
||||
specify JavaScript on the command line, the \fI\%\-\-shell\fP option
|
||||
provides the user with a shell prompt after the file finishes executing.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-nodb
|
||||
Prevents the shell from connecting to any database instances. Later,
|
||||
to connect to a database within the shell, see
|
||||
Prevents the shell from connecting to any database instances. Later, to
|
||||
connect to a database within the shell, see
|
||||
\fImongo\-shell\-new\-connections\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-norc
|
||||
Prevents the shell from sourcing and evaluating
|
||||
\fB~/.mongorc.js\fP on start up.
|
||||
Prevents the shell from sourcing and evaluating \fB~/.mongorc.js\fP on
|
||||
start up.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -77,177 +75,60 @@ Silences output from the shell during the connection process.
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port where the \fBmongod\fP or \fBmongos\fP
|
||||
instance is listening. Unless specified \fBmongo\fP connects
|
||||
to \fBmongod\fP instances on port \fB27017\fP, which is the default
|
||||
\fBmongod\fP port.
|
||||
instance is listening. If \fI\-\-port\fP is not specified,
|
||||
\fBmongo\fP attempts to connect to port \fB27017\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname>
|
||||
specifies the host where the \fBmongod\fP or \fBmongos\fP is running to
|
||||
connect to as \fB<hostname>\fP\&. By default \fBmongo\fP will attempt
|
||||
to connect to a MongoDB process running on the localhost.
|
||||
Specifies the name of the host machine where the \fBmongod\fP or
|
||||
\fBmongos\fP is running. If this is not specified,
|
||||
\fBmongo\fP attempts to connect to a MongoDB process running on
|
||||
the localhost.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-eval <javascript>
|
||||
Evaluates a JavaScript expression specified as an argument to this
|
||||
option. \fBmongo\fP does not load its own environment when evaluating
|
||||
code: as a result many options of the shell environment are not
|
||||
available.
|
||||
Evaluates a JavaScript expression that is specified as an argument.
|
||||
\fBmongo\fP does not load its own environment when evaluating code.
|
||||
As a result many options of the shell environment are not available.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance.
|
||||
Use in conjunction with the
|
||||
\fI\-\-password\fP option to supply a password.
|
||||
If you specify a username and password but the default database
|
||||
or the specified database do not require authentication,
|
||||
\fBmongo\fP will exit with an exception.
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance.
|
||||
Use in conjunction with the
|
||||
\fI\-\-username\fP option to supply a username. If you
|
||||
specify a \fI\-\-username\fP and do not pass an argument to the
|
||||
\fI\-\-password\fP option, \fBmongo\fP will prompt for a
|
||||
password interactively, if the \fBmongod\fP or
|
||||
\fBmongos\fP requires authentication.
|
||||
.sp
|
||||
If you chose not to provide an argument so that \fBmongo\fP
|
||||
will prompt for a password, \fI\-\-password\fP must be the last
|
||||
option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-authenticationDatabase <dbname>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongo\fP assumes that the database name specified
|
||||
in the \fI\%db address\fP holds the user\(aqs
|
||||
credentials, unless you specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-authenticationMechanism <name>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongo\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
Enable connection to a \fBmongod\fP or
|
||||
\fBmongos\fP that has SSL encryption.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
The \fI\%default distribution of MongoDB\fP does \fBnot\fP contain support
|
||||
for SSL. To use SSL you can either compile MongoDB with SSL support
|
||||
or use MongoDB Enterprise\&. See http://docs.mongodb.org/manual/tutorial/configure\-ssl for
|
||||
more information about SSL and MongoDB.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL
|
||||
certificate and key. Specify the file name of the \fB\&.pem\fP
|
||||
file using relative or absolute paths
|
||||
.sp
|
||||
Required when using the \fI\-\-ssl\fP option if the
|
||||
\fBmongod\fP or \fBmongos\fP has \fBsslCAFile\fP
|
||||
enabled \fIwithout\fP \fBsslWeakCertificateValidation\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
The \fI\%default distribution of MongoDB\fP does \fBnot\fP contain support
|
||||
for SSL. To use SSL you can either compile MongoDB with SSL support
|
||||
or use MongoDB Enterprise\&. See http://docs.mongodb.org/manual/tutorial/configure\-ssl for
|
||||
more information about SSL and MongoDB.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Specifies the password to decrypt the root certificate chain
|
||||
specified by \fI\-\-sslPEMKeyFile\fP\&.
|
||||
.sp
|
||||
Only required if the certificate\-key file is encrypted.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
The \fI\%default distribution of MongoDB\fP does \fBnot\fP contain support
|
||||
for SSL. To use SSL you can either compile MongoDB with SSL support
|
||||
or use MongoDB Enterprise\&. See http://docs.mongodb.org/manual/tutorial/configure\-ssl for
|
||||
more information about SSL and MongoDB.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the certificate from
|
||||
the Certificate Authority. Specify the file name of the \fB\&.pem\fP
|
||||
file using relative or absolute paths
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help, \-h
|
||||
Returns a basic help and usage text.
|
||||
Returns information on \fBmongo\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the shell.
|
||||
Returns the \fBmongo\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose
|
||||
Increases the verbosity of the output of the shell during the
|
||||
connection process.
|
||||
Increases the verbosity of the output of the shell during the connection
|
||||
process.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongo\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongo\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongo\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongo\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -266,10 +147,10 @@ mongo admin
|
||||
.UNINDENT
|
||||
.sp
|
||||
The above command will connect the \fBmongo\fP shell to the
|
||||
\fIadmin database\fP on the local machine. You may specify a
|
||||
remote database instance, with the resolvable hostname or IP
|
||||
address. Separate the database name from the hostname using a
|
||||
\fB/\fP character. See the following examples:
|
||||
\fIadmin database\fP on the local machine. You may specify a remote
|
||||
database instance, with the resolvable hostname or IP address. Separate
|
||||
the database name from the hostname using a \fB/\fP character. See the
|
||||
following examples:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -286,17 +167,17 @@ mongo 10.8.8.10/test
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B <file.js>
|
||||
Specifies a JavaScript file to run and then exit.
|
||||
Generally this should be the last option specified.
|
||||
Specifies a JavaScript file to run and then exit. Generally this should
|
||||
be the last option specified.
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.SS Optional
|
||||
.sp
|
||||
To specify a JavaScript file to execute \fIand\fP allow
|
||||
\fBmongo\fP to prompt you for a password using
|
||||
\fI\-\-password\fP, pass the filename as the first parameter
|
||||
with \fI\-\-username\fP and \fI\-\-password\fP s the last
|
||||
options as in the following:
|
||||
\fI\-\-password\fP, pass the filename as the first parameter with
|
||||
\fI\-\-username\fP and \fI\-\-password\fP as the last options, as
|
||||
in the following:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -310,19 +191,145 @@ mongo file.js \-\-username username \-\-password
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Use the \fI\%--shell\fP option to return to a shell after the
|
||||
file finishes running.
|
||||
Use the \fI\%\-\-shell\fP option to return to a shell after the file
|
||||
finishes running.
|
||||
.UNINDENT
|
||||
.SS Files
|
||||
.sp
|
||||
\fB~/.dbshell\fP
|
||||
.SS Authentication Options
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.TP
|
||||
.B \-\-authenticationDatabase <dbname>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongo\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-authenticationMechanism <name>
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongo\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.SS SSL Options
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongo\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongo\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongo\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.SH FILES
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \fB~/.dbshell\fP
|
||||
\fBmongo\fP maintains a history of commands in the \fB\&.dbshell\fP
|
||||
file.
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
\fBmongo\fP does not recorded interaction related to
|
||||
authentication in the history file, including
|
||||
@ -331,7 +338,7 @@ authentication in the history file, including
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fBWARNING:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
Versions of Windows \fBmongo.exe\fP earlier than 2.2.0 will
|
||||
save the \fI\&.dbshell\fP file in the \fBmongo.exe\fP working
|
||||
@ -339,45 +346,49 @@ directory.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fB~/.mongorc.js\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.TP
|
||||
.B \fB~/.mongorc.js\fP
|
||||
\fBmongo\fP will read the \fB\&.mongorc.js\fP file from the home
|
||||
directory of the user invoking \fBmongo\fP\&. In the file, users
|
||||
can define variables, customize the \fBmongo\fP shell prompt,
|
||||
or update information that they would like updated every time they
|
||||
launch a shell. If you use the shell to evaluate a JavaScript file
|
||||
or expression either on the command line with \fI\%--eval\fP or
|
||||
or expression either on the command line with \fI\%\-\-eval\fP or
|
||||
by specifying \fI\%a .js file to mongo\fP,
|
||||
\fBmongo\fP will read the \fB\&.mongorc.js\fP file \fIafter\fP the
|
||||
JavaScript has finished processing.
|
||||
.sp
|
||||
Specify the \fI\%--norc\fP option to disable
|
||||
Specify the \fI\%\-\-norc\fP option to disable
|
||||
reading \fB\&.mongorc.js\fP\&.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fB/tmp/mongo_edit\fI<time_t>\fP\&.js\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
Created by \fBmongo\fP when editing a file. If the file
|
||||
exists \fBmongo\fP will append an integer from \fB1\fP to \fB10\fP to the
|
||||
.TP
|
||||
.B \fB/etc/mongorc.js\fP
|
||||
Global \fBmongorc.js\fP file which the \fBmongo\fP shell
|
||||
evaluates upon start\-up. If a user also has a \fB\&.mongorc.js\fP
|
||||
file located in the \fI\%HOME\fP directory, the \fBmongo\fP
|
||||
shell evaluates the global \fB/etc/mongorc.js\fP file \fIbefore\fP
|
||||
evaluating the user\(aqs \fB\&.mongorc.js\fP file.
|
||||
.sp
|
||||
\fB/etc/mongorc.js\fP must have read permission for the user
|
||||
running the shell. The \fI\%\-\-norc\fP option for \fBmongo\fP
|
||||
suppresses only the user\(aqs \fB\&.mongorc.js\fP file.
|
||||
.sp
|
||||
On Windows, the global \fBmongorc.js </etc/mongorc.js>\fP exists
|
||||
in the \fB%ProgramData%\eMongoDB\fP directory.
|
||||
.TP
|
||||
.B \fB/tmp/mongo_edit\fI<time_t>\fP\&.js\fP
|
||||
Created by \fBmongo\fP when editing a file. If the file exists,
|
||||
\fBmongo\fP will append an integer from \fB1\fP to \fB10\fP to the
|
||||
time value to attempt to create a unique file.
|
||||
.TP
|
||||
.B \fB%TEMP%mongo_edit\fI<time_t>\fP\&.js\fP
|
||||
Created by \fBmongo.exe\fP on Windows when editing a file. If
|
||||
the file exists, \fBmongo\fP will append an integer from \fB1\fP
|
||||
to \fB10\fP to the time value to attempt to create a unique file.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fB%TEMP%mongo_edit\fI<time_t>\fP\&.js\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
Created by \fBmongo.exe\fP on Windows when editing a file.
|
||||
If the file
|
||||
exists \fBmongo\fP will append an integer from \fB1\fP to \fB10\fP to
|
||||
the time value to attempt to create a unique file.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SS Environment
|
||||
.SH ENVIRONMENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B EDITOR
|
||||
@ -762,6 +773,6 @@ the additional JavaScript required to generate this output.
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
1627
debian/mongod.1
vendored
1627
debian/mongod.1
vendored
File diff suppressed because it is too large
Load Diff
146
debian/mongodb-enterprise-unstable.control
vendored
146
debian/mongodb-enterprise-unstable.control
vendored
@ -10,118 +10,108 @@ Package: mongodb-enterprise-unstable
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-tools
|
||||
Description: MongoDB cross-platform document-oriented database system (enterprise metapackage)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB open source document-oriented database system (enterprise metapackage)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This metapackage will install the mongo shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.
|
||||
|
||||
Package: mongodb-enterprise-unstable-shell
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0, libkrb5-3
|
||||
Description: MongoDB shell client (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongo shell.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the mongo shell.
|
||||
|
||||
Package: mongodb-enterprise-unstable-server
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0, libkrb5-3, libsnmp15, snmp
|
||||
Description: MongoDB database server (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongod server.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the MongoDB server software, default configuration files, and init.d scripts.
|
||||
|
||||
Package: mongodb-enterprise-unstable-mongos
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0, libkrb5-3
|
||||
Description: MongoDB sharding router (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB sharded cluster query router (enterprise)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongos program.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains mongos, the MongoDB sharded cluster query router.
|
||||
|
||||
Package: mongodb-enterprise-unstable-tools
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0, libkrb5-3
|
||||
Description: MongoDB tools (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs standard utilities for
|
||||
interacting with MongoDB.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains standard utilities for interacting with MongoDB.
|
||||
|
||||
146
debian/mongodb-enterprise.control
vendored
146
debian/mongodb-enterprise.control
vendored
@ -10,118 +10,108 @@ Package: mongodb-enterprise
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: mongodb-enterprise-shell, mongodb-enterprise-server, mongodb-enterprise-mongos, mongodb-enterprise-tools
|
||||
Description: MongoDB cross-platform document-oriented database system (enterprise metapackage)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB open source document-oriented database system (enterprise metapackage)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This metapackage will install the mongo shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.
|
||||
|
||||
Package: mongodb-enterprise-shell
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0
|
||||
Description: MongoDB shell client (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongo shell.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the mongo shell.
|
||||
|
||||
Package: mongodb-enterprise-server
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0, libsnmp15
|
||||
Description: MongoDB database server (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongod server.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the MongoDB server software, default configuration files, and init.d scripts.
|
||||
|
||||
Package: mongodb-enterprise-mongos
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0
|
||||
Description: MongoDB sharding router (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB sharded cluster query router (enterprise)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongos program.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains mongos, the MongoDB sharded cluster query router.
|
||||
|
||||
Package: mongodb-enterprise-tools
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-server, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-org-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), libsasl2-2, libssl1.0.0
|
||||
Description: MongoDB tools (enterprise)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs standard utilities for
|
||||
interacting with MongoDB.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains standard utilities for interacting with MongoDB.
|
||||
|
||||
146
debian/mongodb-org-unstable.control
vendored
146
debian/mongodb-org-unstable.control
vendored
@ -10,118 +10,108 @@ Package: mongodb-org-unstable
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), mongodb-org-unstable-shell, mongodb-org-unstable-server, mongodb-org-unstable-mongos, mongodb-org-unstable-tools
|
||||
Description: MongoDB cross-platform document-oriented database system (metapackage)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB open source document-oriented database system (metapackage)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This metapackage will install the mongo shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.
|
||||
|
||||
Package: mongodb-org-unstable-shell
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB shell client
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongo shell.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the mongo shell.
|
||||
|
||||
Package: mongodb-org-unstable-server
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB database server
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongod server.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the MongoDB server software, default configuration files, and init.d scripts.
|
||||
|
||||
Package: mongodb-org-unstable-mongos
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB sharding router
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB sharded cluster query router
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongos program.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains mongos, the MongoDB sharded cluster query router.
|
||||
|
||||
Package: mongodb-org-unstable-tools
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org, mongodb-org-mongos, mongodb-org-server, mongodb-org-shell, mongodb-org-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB tools
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs standard utilities for
|
||||
interacting with MongoDB.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains standard utilities for interacting with MongoDB.
|
||||
|
||||
146
debian/mongodb-org.control
vendored
146
debian/mongodb-org.control
vendored
@ -10,118 +10,108 @@ Package: mongodb-org
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1), mongodb-org-shell, mongodb-org-server, mongodb-org-mongos, mongodb-org-tools
|
||||
Description: MongoDB cross-platform document-oriented database system (metapackage)
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB open source document-oriented database system (metapackage)
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This metapackage will install the mongo shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.
|
||||
|
||||
Package: mongodb-org-shell
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB shell client
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongo shell.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the mongo shell.
|
||||
|
||||
Package: mongodb-org-server
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB database server
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongod server.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains the MongoDB server software, default configuration files, and init.d scripts.
|
||||
|
||||
Package: mongodb-org-mongos
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB sharding router
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
Description: MongoDB sharded cluster query router
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs the mongos program.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains mongos, the MongoDB sharded cluster query router.
|
||||
|
||||
Package: mongodb-org-tools
|
||||
Conflicts: mongo-10gen, mongo-10gen-enterprise, mongo-10gen-enterprise-server, mongo-10gen-server, mongo-10gen-unstable, mongo-10gen-unstable-enterprise, mongo-10gen-unstable-enterprise-mongos, mongo-10gen-unstable-enterprise-server, mongo-10gen-unstable-enterprise-shell, mongo-10gen-unstable-enterprise-tools, mongo-10gen-unstable-mongos, mongo-10gen-unstable-server, mongo-10gen-unstable-shell, mongo-10gen-unstable-tools, mongo18-10gen, mongo18-10gen-server, mongo20-10gen, mongo20-10gen-server, mongodb, mongodb-server, mongodb-dev, mongodb-clients, mongodb-10gen, mongodb-10gen-enterprise, mongodb-10gen-unstable, mongodb-10gen-unstable-enterprise, mongodb-10gen-unstable-enterprise-mongos, mongodb-10gen-unstable-enterprise-server, mongodb-10gen-unstable-enterprise-shell, mongodb-10gen-unstable-enterprise-tools, mongodb-10gen-unstable-mongos, mongodb-10gen-unstable-server, mongodb-10gen-unstable-shell, mongodb-10gen-unstable-tools, mongodb-enterprise, mongodb-enterprise-mongos, mongodb-enterprise-server, mongodb-enterprise-shell, mongodb-enterprise-tools, mongodb-enterprise-unstable, mongodb-enterprise-unstable-mongos, mongodb-enterprise-unstable-shell, mongodb-enterprise-unstable-tools, mongodb-enterprise-unstable-server, mongodb-nightly, mongodb-org-unstable, mongodb-org-unstable-mongos, mongodb-org-unstable-server, mongodb-org-unstable-shell, mongodb-org-unstable-tools, mongodb-stable, mongodb18-10gen, mongodb20-10gen
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.3.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.1.1)
|
||||
Description: MongoDB tools
|
||||
MongoDB is a high-performance, open source, schema-free
|
||||
document-oriented data store that's easy to deploy, manage
|
||||
and use. It's network accessible, written in C++ and offers
|
||||
the following features :
|
||||
MongoDB is built for scalability, performance and high availability, scaling from single server deployments to large, complex multi-site architectures. By leveraging in-memory computing, MongoDB provides high performance for both reads and writes. MongoDB’s native replication and automated failover enable enterprise-grade reliability and operational flexibility.
|
||||
.
|
||||
* Collection oriented storage - easy storage of object-
|
||||
style data
|
||||
* Full index support, including on inner objects
|
||||
* Query profiling
|
||||
* Replication and fail-over support
|
||||
* Efficient storage of binary data including large
|
||||
objects (e.g. videos)
|
||||
* Automatic partitioning for cloud-level scalability
|
||||
MongoDB is an open-source database used by companies of all sizes, across all industries and for a wide variety of applications. It is an agile database that allows schemas to change quickly as applications evolve, while still providing the functionality developers expect from traditional databases, such as secondary indexes, a full query language and strict consistency.
|
||||
.
|
||||
High performance, scalability, and reasonable depth of
|
||||
functionality are the goals for the project.
|
||||
MongoDB has a rich client ecosystem including hadoop integration, officially supported drivers for 10 programming languages and environments, as well as 40 drivers supported by the user community.
|
||||
.
|
||||
This Debian package installs standard utilities for
|
||||
interacting with MongoDB.
|
||||
MongoDB features:
|
||||
* JSON Data Model with Dynamic Schemas
|
||||
* Auto-Sharding for Horizontal Scalability
|
||||
* Built-In Replication for High Availability
|
||||
* Rich Secondary Indexes, including geospatial
|
||||
* TTL indexes
|
||||
* Text Search
|
||||
* Aggregation Framework & Native MapReduce
|
||||
.
|
||||
This package contains standard utilities for interacting with MongoDB.
|
||||
|
||||
571
debian/mongodump.1
vendored
571
debian/mongodump.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGODUMP" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGODUMP" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongodump \- MongoDB
|
||||
mongodump \- MongoDB Data Dump Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -30,18 +30,6 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
||||
..
|
||||
.INDENT 0.0
|
||||
.IP \(bu 2
|
||||
\fI\%Synopsis\fP
|
||||
.IP \(bu 2
|
||||
\fI\%Options\fP
|
||||
.IP \(bu 2
|
||||
\fI\%Behavior\fP
|
||||
.IP \(bu 2
|
||||
\fI\%Required User Privileges\fP
|
||||
.IP \(bu 2
|
||||
\fI\%Usage\fP
|
||||
.UNINDENT
|
||||
.SH SYNOPSIS
|
||||
.sp
|
||||
\fBmongodump\fP is a utility for creating a binary export of the
|
||||
@ -54,23 +42,6 @@ restore databases.
|
||||
instances, in addition to reading directly from MongoDB data files
|
||||
without an active \fBmongod\fP\&.
|
||||
.sp
|
||||
\fBIMPORTANT:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
\fBmongodump\fP does \fInot\fP create output for the
|
||||
\fBlocal\fP database.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
The format of data created by \fBmongodump\fP tool from the
|
||||
2.2 distribution or later is different and incompatible with
|
||||
earlier versions of \fBmongod\fP\&.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fBSEE ALSO:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
@ -79,6 +50,59 @@ http://docs.mongodb.org/manual/tutorial/backup\-sharded\-cluster\-with\-database
|
||||
and http://docs.mongodb.org/manual/core/backups\&.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH BEHAVIOR
|
||||
.sp
|
||||
\fBmongodump\fP does \fInot\fP dump the content of the \fBlocal\fP database.
|
||||
.sp
|
||||
The data format used by \fBmongodump\fP from version 2.2 or
|
||||
later is \fIincompatible\fP with earlier versions of \fBmongod\fP\&.
|
||||
Do not use recent versions of \fBmongodump\fP to back up older
|
||||
data stores.
|
||||
.sp
|
||||
When running \fBmongodump\fP against a \fBmongos\fP instance
|
||||
where the \fIsharded cluster\fP consists of \fIreplica sets\fP, the \fIread preference\fP of the operation will prefer reads
|
||||
from \fIsecondary\fP members of the set.
|
||||
.sp
|
||||
Changed in version 2.2: When used in combination with \fBfsync\fP or
|
||||
\fBdb.fsyncLock()\fP, \fBmongod\fP may block some
|
||||
reads, including those from \fBmongodump\fP, when
|
||||
queued write operation waits behind the \fBfsync\fP
|
||||
lock.
|
||||
|
||||
.SH REQUIRED ACCESS
|
||||
.SS Backup Collections
|
||||
.sp
|
||||
To backup all the databases in a cluster via \fBmongodump\fP, you
|
||||
should have the \fBbackup\fP role. The \fBbackup\fP role provides
|
||||
all the needed privileges for backing up all database. The role confers no
|
||||
additional access, in keeping with the policy of \fIleast privilege\fP\&.
|
||||
.sp
|
||||
To backup a given database, you must have \fBread\fP access on the database.
|
||||
Several roles provide this access, including the \fBbackup\fP role.
|
||||
.sp
|
||||
To backup the \fBsystem.profile\fP collection in a database, you must have
|
||||
\fBread\fP access on certain system collections in the database. Several roles
|
||||
provide this access, including the \fBclusterAdmin\fP and
|
||||
\fBdbAdmin\fP roles.
|
||||
.SS Backup Users
|
||||
.sp
|
||||
Changed in version 2.6.
|
||||
|
||||
.sp
|
||||
To backup users and \fIuser\-defined roles\fP for a
|
||||
given database, you must have access to the \fBadmin\fP database. MongoDB
|
||||
stores the user data and role definitions for all databases in the
|
||||
\fBadmin\fP database.
|
||||
.sp
|
||||
Specifically, to backup a given database\(aqs users, you must have the
|
||||
\fBfind\fP \fIaction\fP on the \fBadmin\fP
|
||||
database\(aqs \fBadmin.system.users\fP collection. The \fBbackup\fP
|
||||
and \fBuserAdminAnyDatabase\fP roles both provide this privilege.
|
||||
.sp
|
||||
To backup the user\-defined roles on a database, you must have the
|
||||
\fBfind\fP action on the \fBadmin\fP database\(aqs
|
||||
\fBadmin.system.roles\fP collection. Both the \fBbackup\fP and
|
||||
\fBuserAdminAnyDatabase\fP roles provide this privilege.
|
||||
.SH OPTIONS
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -90,43 +114,52 @@ and http://docs.mongodb.org/manual/core/backups\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongodump\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including the
|
||||
option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongodump\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongodump\fP utility and exits.
|
||||
Returns the \fBmongodump\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP that you wish to
|
||||
use to create the database dump. By default \fBmongodump\fP will
|
||||
attempt to connect to a MongoDB process ruining on the localhost
|
||||
port number \fB27017\fP\&.
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongodump\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, use the \fI\-\-host\fP
|
||||
argument with a setname, followed by a slash and a comma\-separated
|
||||
list of host names and port numbers. The \fBmongodump\fP
|
||||
utility will, given the seed of at least one connected set member,
|
||||
connect to the primary member of that set. This option would resemble:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
mongodump \-\-host repl0/mongo0.example.net,mongo0.example.net:27018,mongo1.example.net,mongo2.example.net
|
||||
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
@ -138,62 +171,131 @@ specifying the host and port number directly.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running
|
||||
on the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fI\-\-host\fP option.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongodump\fP to connect to
|
||||
the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongodump\fP, disable IPv6 support
|
||||
by default.
|
||||
Enables IPv6 support, which allows \fBmongodump\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongodump\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongodump\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongodump is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongodump does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongodump\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if
|
||||
your database requires authentication. Use in conjunction with the
|
||||
\fI\-\-password\fP option to supply a
|
||||
password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fI\-\-username\fP
|
||||
option to supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and do
|
||||
not pass an argument to \fI\%--password\fP, \fBmongodump\fP
|
||||
will prompt for a password interactively. If you do not specify a
|
||||
password on the command line, \fI\%--password\fP must be the last
|
||||
argument specified.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongodump\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongodump\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongodump\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -201,17 +303,10 @@ argument specified.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongodump\fP assumes that the database specified to the
|
||||
\fI\%--db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\%--authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongodump\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -219,235 +314,151 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongodump\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongodump\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies the directory of the MongoDB data files. If used, the
|
||||
\fI\%--dbpath\fP option enables \fBmongodump\fP to attach
|
||||
directly to local data files and copy the data without the
|
||||
\fBmongod\fP\&. To run with \fI\%--dbpath\fP,
|
||||
\fBmongodump\fP needs to restrict access to the data
|
||||
directory: as a result, no \fBmongod\fP can access the same
|
||||
path while the process runs.
|
||||
\fI\-\-dbpath\fP option enables \fBmongodump\fP to attach directly to local data
|
||||
files without a running \fBmongod\fP\&. When run with \fI\-\-dbpath\fP,
|
||||
\fBmongodump\fP locks access to the data directory. No \fBmongod\fP can
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\%--directoryperdb\fP in conjunction with the
|
||||
corresponding option to \fBmongod\fP\&. This option allows
|
||||
\fBmongodump\fP to read data files organized with each
|
||||
database located in a distinct directory. This option is only
|
||||
relevant when specifying the \fI\%--dbpath\fP option.
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongodump\fP to access data from MongoDB
|
||||
instances that use an on\-disk format where every database has a distinct
|
||||
directory. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongodump\fP operations to use the durability
|
||||
\fIjournal\fP to ensure that the export is in a
|
||||
consistent state. This option is only relevant when specifying the
|
||||
\fI\%--dbpath\fP option.
|
||||
Allows \fBmongodump\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-db <db>, \-d <db>
|
||||
Use the \fI\%--db\fP option to specify a database for
|
||||
\fBmongodump\fP to backup. If you do not specify a DB,
|
||||
\fBmongodump\fP copies all databases in this instance into the
|
||||
dump files. Use this option to backup or copy a smaller subset of
|
||||
your data.
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies a database to backup. If you do not specify a database,
|
||||
\fBmongodump\fP copies all databases in this instance into the dump
|
||||
files.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c <collection>
|
||||
Use the \fI\%--collection\fP option to specify a collection for
|
||||
\fBmongodump\fP to backup. If you do not specify a collection,
|
||||
this option copies all collections in the specified database or
|
||||
instance to the dump files. Use this option to backup or copy a
|
||||
smaller subset of your data.
|
||||
.B \-\-collection <collection>, \-c
|
||||
Specifies a collection to backup. If you do not specify a collection,
|
||||
this option copies all collections in the specified database or instance
|
||||
to the dump files.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-out <path>, \-o <path>
|
||||
Specifies a directory where \fBmongodump\fP saves the output of
|
||||
the database dump. By default, \fBmongodump\fP saves output
|
||||
files in a directory named \fBdump\fP in the current working directory.
|
||||
.B \-\-out <path>, \-o
|
||||
Specifies the directory where \fBmongodump\fP saves the output of
|
||||
the database dump. By default, \fBmongodump\fP saves output files
|
||||
in a directory named \fBdump\fP in the current working directory.
|
||||
.sp
|
||||
To send the database dump to standard output, specify "\fB\-\fP"
|
||||
instead of a path. Write to standard output if you want process the
|
||||
output before saving it, such as to use \fBgzip\fP to compress the
|
||||
dump. When writing standard output, \fBmongodump\fP does not
|
||||
write the metadata that writes in a \fB<dbname>.metadata.json\fP file
|
||||
when writing to files directly.
|
||||
To send the database dump to standard output, specify "\fB\-\fP" instead of
|
||||
a path. Write to standard output if you want process the output before
|
||||
saving it, such as to use \fBgzip\fP to compress the dump. When writing
|
||||
standard output, \fBmongodump\fP does not write the metadata that
|
||||
writes in a \fB<dbname>.metadata.json\fP file when writing to files
|
||||
directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-query <json>, \-q <json>
|
||||
Provides a query to limit (optionally) the documents included in
|
||||
the output of \fBmongodump\fP\&.
|
||||
.B \-\-query <json>, \-q
|
||||
Provides a \fIJSON document\fP as a query that optionally limits the
|
||||
documents included in the output of \fBmongodump\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-oplog
|
||||
Use this option to ensure that \fBmongodump\fP creates a dump
|
||||
of the database that includes an \fIoplog\fP, to create a
|
||||
point\-in\-time snapshot of the state of a \fBmongod\fP instance. To
|
||||
restore to a specific point\-in\-time backup, use the output created
|
||||
with this option in conjunction with \fImongorestore \-\-oplogReplay\fP\&.
|
||||
Ensures that \fBmongodump\fP creates a dump of
|
||||
the database that includes a partial \fIoplog\fP containing operations
|
||||
from the duration of the \fBmongodump\fP operation. This oplog
|
||||
produces an effective point\-in\-time snapshot of the state of a
|
||||
\fBmongod\fP instance. To restore to a specific point\-in\-time
|
||||
backup, use the output created with this option in conjunction with
|
||||
\fImongorestore \-\-oplogReplay\fP\&.
|
||||
.sp
|
||||
Without \fI\%--oplog\fP, if there are write operations during the
|
||||
dump operation, the dump will not reflect a single moment in
|
||||
time. Changes made to the database during the update process can
|
||||
affect the output of the backup.
|
||||
Without \fI\%\-\-oplog\fP, if there are write operations during the dump
|
||||
operation, the dump will not reflect a single moment in time. Changes
|
||||
made to the database during the update process can affect the output of
|
||||
the backup.
|
||||
.sp
|
||||
\fI\%--oplog\fP has no effect when running \fBmongodump\fP
|
||||
against a \fBmongos\fP instance to dump the entire contents of
|
||||
a sharded cluster. However, you can use \fI\%--oplog\fP to dump
|
||||
\fI\%\-\-oplog\fP has no effect when running \fBmongodump\fP
|
||||
against a \fBmongos\fP instance to dump the entire contents of a
|
||||
sharded cluster. However, you can use \fI\%\-\-oplog\fP to dump
|
||||
individual shards.
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
\fI\%--oplog\fP only works against nodes that maintain an
|
||||
\fIoplog\fP\&. This includes all members of a replica set, as
|
||||
well as \fImaster\fP nodes in master/slave replication
|
||||
deployments.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
\fI\%\-\-oplog\fP only works against nodes that maintain an
|
||||
\fIoplog\fP\&. This includes all members of a replica set, as well as
|
||||
\fImaster\fP nodes in master/slave replication deployments.
|
||||
.sp
|
||||
\fI\%\-\-oplog\fP does not dump the oplog collection.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-repair
|
||||
Use this option to run a repair option in addition to dumping the
|
||||
database. The repair option attempts to repair a database that may
|
||||
be in an inconsistent state as a result of an improper shutdown or
|
||||
Runs a repair option in addition to dumping the
|
||||
database. The repair option attempts to repair a database that may be in
|
||||
an invalid state as a result of an improper shutdown or
|
||||
\fBmongod\fP crash.
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
The \fI\%\-\-repair\fP option uses aggressive data\-recovery algorithms
|
||||
that may produce a large amount of duplication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-forceTableScan
|
||||
Forces \fBmongodump\fP to scan the data store directly: typically,
|
||||
\fBmongodump\fP saves entries as they appear in the index of the
|
||||
\fB_id\fP field. Use \fI\-\-forceTableScan\fP to skip the index and scan
|
||||
the data directly. Typically there are two cases where this behavior is
|
||||
preferable to the default:
|
||||
.INDENT 7.0
|
||||
.IP 1. 3
|
||||
If you have key sizes over 800 bytes that would not be present in the
|
||||
\fB_id\fP index.
|
||||
.IP 2. 3
|
||||
Your database uses a custom \fB_id\fP field.
|
||||
.UNINDENT
|
||||
.sp
|
||||
When you run with \fI\-\-forceTableScan\fP, \fBmongodump\fP does
|
||||
not use \fB$snapshot\fP\&. As a result, the dump produced by
|
||||
\fBmongodump\fP can reflect the state of the database at many
|
||||
different points in time.
|
||||
.sp
|
||||
\fBIMPORTANT:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
The \fI\%--repair\fP option uses aggressive
|
||||
data\-recovery algorithms that may produce a large amount of
|
||||
duplication.
|
||||
Use \fI\-\-forceTableScan\fP with extreme caution and
|
||||
consideration.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-forceTableScan
|
||||
Forces \fBmongodump\fP to scan the data store directly:
|
||||
typically, \fBmongodump\fP saves entries as they appear in the
|
||||
index of the \fB_id\fP field. Use \fI\%--forceTableScan\fP to skip
|
||||
the index and scan the data directly. Typically there are two cases
|
||||
where this behavior is preferable to the default:
|
||||
.INDENT 7.0
|
||||
.IP 1. 3
|
||||
If you have key sizes over 800 bytes that would not be present
|
||||
in the \fB_id\fP index.
|
||||
.IP 2. 3
|
||||
Your database uses a custom \fB_id\fP field.
|
||||
.B \-\-dumpDbUsersAndRoles
|
||||
Includes user and role definitions when performing \fBmongodump\fP
|
||||
on a specific database. This option applies only when you specify a
|
||||
database in the \fI\-\-db\fP option. MongoDB always includes user and
|
||||
role definitions when \fBmongodump\fP applies to an entire instance
|
||||
and not just a specific database.
|
||||
.UNINDENT
|
||||
.SH USE
|
||||
.sp
|
||||
When you run with \fI\%--forceTableScan\fP, \fBmongodump\fP
|
||||
does not use \fB$snapshot\fP\&. As a result, the dump produced
|
||||
by \fBmongodump\fP can reflect the state of the database at
|
||||
many different points in time.
|
||||
.sp
|
||||
\fBIMPORTANT:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
Use \fI\%--forceTableScan\fP with extreme caution
|
||||
and consideration.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH BEHAVIOR
|
||||
.sp
|
||||
When running \fBmongodump\fP against a \fBmongos\fP instance
|
||||
where the \fIsharded cluster\fP consists of \fIreplica sets\fP, the \fIread preference\fP of the operation will prefer reads
|
||||
from \fIsecondary\fP members of the set.
|
||||
.sp
|
||||
\fBWARNING:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
Changed in version 2.2: When used in combination with \fBfsync\fP or
|
||||
\fBdb.fsyncLock()\fP, \fBmongod\fP may block some
|
||||
reads, including those from \fBmongodump\fP, when
|
||||
queued write operation waits behind the \fBfsync\fP
|
||||
lock.
|
||||
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH REQUIRED USER PRIVILEGES
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
User privileges changed in MongoDB 2.4.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
The user must have appropriate privileges to read data from database
|
||||
holding collections in order to use \fBmongodump\fP\&. Consider the
|
||||
following \fBrequired privileges\fP for
|
||||
the following \fBmongodump\fP operations:
|
||||
.TS
|
||||
center;
|
||||
|l|l|.
|
||||
_
|
||||
T{
|
||||
Task
|
||||
T} T{
|
||||
Required Privileges
|
||||
T}
|
||||
_
|
||||
T{
|
||||
All collections in a database except \fBsystem.users\fP\&.
|
||||
T} T{
|
||||
\fBread\fP\&. [1]
|
||||
T}
|
||||
_
|
||||
T{
|
||||
All collections in a database, including \fBsystem.users\fP\&.
|
||||
T} T{
|
||||
\fBread\fP [1] and \fBuserAdmin\fP\&.
|
||||
T}
|
||||
_
|
||||
T{
|
||||
All databases. [3]
|
||||
T} T{
|
||||
\fBreadAnyDatabase\fP, \fBuserAdminAnyDatabase\fP,
|
||||
and \fBclusterAdmin\fP\&. [2]
|
||||
T}
|
||||
_
|
||||
.TE
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/reference/user\-privileges and
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents for more information on user
|
||||
roles.
|
||||
.IP [1] 5
|
||||
You may provision \fBreadWrite\fP
|
||||
instead of \fBread\fP\&.
|
||||
.IP [2] 5
|
||||
\fBclusterAdmin\fP provides the ability to
|
||||
run the \fBlistDatabases\fP command, to list all existing
|
||||
databases.
|
||||
.IP [3] 5
|
||||
If any database runs with profiling enabled,
|
||||
\fBmongodump\fP may need the
|
||||
\fBdbAdminAnyDatabase\fP privilege to dump the
|
||||
\fBsystem.profile\fP collection.
|
||||
.SH USAGE
|
||||
.sp
|
||||
See the http://docs.mongodb.org/manual/tutorial/backup\-databases\-with\-binary\-database\-dumps
|
||||
See the http://docs.mongodb.org/manual/tutorial/backup\-with\-mongodump
|
||||
for a larger overview of \fBmongodump\fP usage. Also see the
|
||||
\fBmongorestore\fP document for an overview of the
|
||||
\fBmongorestore\fP, which provides the related inverse
|
||||
@ -501,6 +512,6 @@ mongodump \-\-host mongodb1.example.net \-\-port 37017 \-\-username user \-\-pas
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
454
debian/mongoexport.1
vendored
454
debian/mongoexport.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOEXPORT" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOEXPORT" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongoexport \- MongoDB
|
||||
mongoexport \- MongoDB Export Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -38,17 +38,13 @@ http://docs.mongodb.org/manual/core/import\-export document for a more in depth
|
||||
usage overview, and the \fBmongoimport\fP document for more
|
||||
information regarding the \fBmongoimport\fP utility, which
|
||||
provides the inverse "importing" capability.
|
||||
.SH CONSIDERATIONS
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
Do not use \fBmongoimport\fP and \fBmongoexport\fP for
|
||||
full\-scale backups because they may not reliably capture data type
|
||||
information. Use \fBmongodump\fP and \fBmongorestore\fP as
|
||||
described in http://docs.mongodb.org/manual/core/backups for this kind of
|
||||
functionality.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
full\-scale production backups because they may not reliably capture
|
||||
data type information. Use \fBmongodump\fP and
|
||||
\fBmongorestore\fP as described in http://docs.mongodb.org/manual/core/backups for this
|
||||
kind of functionality.
|
||||
.SH OPTIONS
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -60,34 +56,46 @@ functionality.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongoexport\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongoexport\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongoexport\fP utility.
|
||||
Returns the \fBmongoexport\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP from which you
|
||||
want to export data. By default \fBmongoexport\fP attempts to
|
||||
connect to a MongoDB process ruining on the localhost port number
|
||||
\fB27017\fP\&.
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongoexport\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -98,65 +106,138 @@ name, and a seed list of set members, in the following format:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can always connect directly to a single MongoDB instance by
|
||||
specifying the host and port number directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running on
|
||||
the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fImongoexport \-\-host\fP command.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongoexport\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongoexport\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongoexport\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongoexport\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongoexport\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongoexport is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongoexport does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongoexport\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if your
|
||||
database requires authentication. Use in conjunction with the
|
||||
\fImongoexport \-\-password\fP option to supply a password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fI\-\-username\fP
|
||||
option to supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and
|
||||
do not pass an argument to \fI\-\-password\fP,
|
||||
\fBmongoexport\fP will prompt for a password interactively. If
|
||||
you do not specify a password on the command line,
|
||||
\fI\-\-password\fP must be the last argument specified.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongoexport\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongoexport\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongoexport\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -164,17 +245,10 @@ you do not specify a password on the command line,
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongoexport\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongoexport\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -182,59 +256,52 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongoexport\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongoexport\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies the directory of the MongoDB data files. If used, the
|
||||
\fB\-\-dbpath\fP option enables \fBmongoexport\fP to attach
|
||||
directly to local data files and insert the data without the
|
||||
\fBmongod\fP\&. To run with \fB\-\-dbpath\fP, \fBmongoexport\fP
|
||||
needs to lock access to the data directory: as a result, no
|
||||
\fBmongod\fP can access the same path while the process runs.
|
||||
\fI\-\-dbpath\fP option enables \fBmongoexport\fP to attach directly to local data
|
||||
files without a running \fBmongod\fP\&. When run with \fI\-\-dbpath\fP,
|
||||
\fBmongoexport\fP locks access to the data directory. No \fBmongod\fP can
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\-\-directoryperdb\fP in conjunction with the
|
||||
corresponding option to \fBmongod\fP, which allows
|
||||
\fBmongoexport\fP to export data from MongoDB instances that
|
||||
have every database\(aqs files saved in discrete directories on the
|
||||
disk. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongoexport\fP to export data from
|
||||
MongoDB instances that have every database\(aqs files saved in discrete
|
||||
directories on the disk. This option is only relevant when specifying
|
||||
the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongoexport\fP operations to access the durability
|
||||
\fIjournal\fP to ensure that the export is in a
|
||||
consistent state. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
Allows \fBmongoexport\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-db <db>, \-d <db>
|
||||
Use the \fI\-\-db\fP option to specify the name of the database
|
||||
that contains the collection you want to export.
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies the name of the database on which to run \fBmongoexport\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c <collection>
|
||||
Use the \fI\-\-collection\fP option to specify the collection
|
||||
that you want \fBmongoexport\fP to export.
|
||||
.B \-\-collection <collection>, \-c
|
||||
Specifies the collection to export.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-fields <field1[,field2]>, \-f <field1[,field2]>
|
||||
Specify a field or fields to \fIinclude\fP in the export. Use a comma
|
||||
.B \-\-fields <field1[,field2]>, \-f
|
||||
Specifies a field or fields to \fIinclude\fP in the export. Use a comma
|
||||
separated list of fields to specify multiple fields.
|
||||
.sp
|
||||
For \fI\-\-csv\fP output formats,
|
||||
@ -249,29 +316,27 @@ its fields, not just the specified field within the document.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-fieldFile <file>
|
||||
.B \-\-fieldFile <filename>
|
||||
As an alternative to \fI\-\-fields\fP, the
|
||||
\fI\-\-fieldFile\fP option allows you to
|
||||
specify in a file the field or fields to \fIinclude\fP in the export and
|
||||
is \fBonly valid\fP with the \fI\-\-csv\fP
|
||||
option. The file must have only one field per line, and the line(s)
|
||||
must end with the LF character (\fB0x0A\fP).
|
||||
specify in a file the field or fields to \fIinclude\fP in the export and is
|
||||
\fBonly valid\fP with the \fI\-\-csv\fP option. The
|
||||
file must have only one field per line, and the line(s) must end with
|
||||
the LF character (\fB0x0A\fP).
|
||||
.sp
|
||||
\fBmongoexport\fP includes only the specified field(s). The
|
||||
specified field(s) can be a field within a sub\-document.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-query <JSON>, \-q <JSON>
|
||||
.B \-\-query <JSON>, \-q
|
||||
Provides a \fIJSON document\fP as a query that optionally limits
|
||||
the documents returned in the export.
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.SH EXAMPLE
|
||||
the documents returned in the export. Specify JSON in \fBstrict
|
||||
format\fP\&.
|
||||
.sp
|
||||
Given a collection named \fBrecords\fP in the database \fBtest\fP
|
||||
with the following documents:
|
||||
.INDENT 0.0
|
||||
For example, given a collection named \fBrecords\fP in the database
|
||||
\fBtest\fP with the following documents:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
@ -286,10 +351,10 @@ with the following documents:
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
The following \fBmongoexport\fP uses the \fI\-q\fP
|
||||
option to export only the documents with the field \fBa\fP greater
|
||||
than or equal to (\fB$gte\fP) to \fB3\fP:
|
||||
.INDENT 0.0
|
||||
The following \fBmongoexport\fP uses the \fI\%\-q\fP option to
|
||||
export only the documents with the field \fBa\fP greater than or equal to
|
||||
(\fB$gte\fP) to \fB3\fP:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
@ -301,7 +366,7 @@ mongoexport \-d test \-c records \-q "{ a: { \e$gte: 3 } } }" \-\-out exportdir/
|
||||
.UNINDENT
|
||||
.sp
|
||||
The resulting file contains the following documents:
|
||||
.INDENT 0.0
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
@ -312,22 +377,30 @@ The resulting file contains the following documents:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can sort the results with the \fI\%\-\-sort\fP option to
|
||||
\fBmongoexport\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-csv
|
||||
Changes the export format to a comma separated values (CSV)
|
||||
Changes the export format to a comma\-separated\-values (CSV)
|
||||
format. By default \fBmongoexport\fP writes data using one
|
||||
\fIJSON\fP document for every MongoDB document.
|
||||
.sp
|
||||
If you specify \fI\%--csv\fP, then you must also use either
|
||||
If you specify \fI\%\-\-csv\fP, then you must also use either
|
||||
the \fI\-\-fields\fP or the \fI\-\-fieldFile\fP option to
|
||||
declare the fields to export from the collection.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-out <file>, \-o
|
||||
Specifies a file to write the export to. If you do not specify a file
|
||||
name, the \fBmongoexport\fP writes data to standard output
|
||||
(e.g. \fBstdout\fP).
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-jsonArray
|
||||
Modifies the output of \fBmongoexport\fP to write the
|
||||
entire contents of the export as a single \fIJSON\fP array. By
|
||||
@ -347,20 +420,13 @@ This is the default behavior.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-out <file>, \-o <file>
|
||||
Specify a file to write the export to. If you do not specify a file
|
||||
name, the \fBmongoexport\fP writes data to standard output
|
||||
(e.g. \fBstdout\fP).
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-forceTableScan
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Forces \fBmongoexport\fP to scan the data store directly:
|
||||
typically, \fBmongoexport\fP saves entries as they appear in the
|
||||
index of the \fB_id\fP field. Use \fI\-\-forceTableScan\fP to skip
|
||||
index of the \fB_id\fP field. Use \fI\%\-\-forceTableScan\fP to skip
|
||||
the index and scan the data directly. Typically there are two cases
|
||||
where this behavior is preferable to the default:
|
||||
.INDENT 7.0
|
||||
@ -371,7 +437,7 @@ in the \fB_id\fP index.
|
||||
Your database uses a custom \fB_id\fP field.
|
||||
.UNINDENT
|
||||
.sp
|
||||
When you run with \fI\-\-forceTableScan\fP, \fBmongoexport\fP
|
||||
When you run with \fI\%\-\-forceTableScan\fP, \fBmongoexport\fP
|
||||
does not use \fB$snapshot\fP\&. As a result, the export produced
|
||||
by \fBmongoexport\fP can reflect the state of the database at
|
||||
many different points in time.
|
||||
@ -379,12 +445,52 @@ many different points in time.
|
||||
\fBWARNING:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
Use \fI\-\-forceTableScan\fP with extreme caution
|
||||
Use \fI\%\-\-forceTableScan\fP with extreme caution
|
||||
and consideration.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH USAGE
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-skip <number>
|
||||
Use \fI\%\-\-skip\fP to control where \fBmongoexport\fP begins
|
||||
exporting documents. See \fBskip()\fP for information about
|
||||
the underlying operation.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-limit <number>
|
||||
Specifies a maximum number of documents to include in the
|
||||
export. See \fBlimit()\fP for information about
|
||||
the underlying operation.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sort <JSON>
|
||||
Specifies an ordering for exported results. If an index does
|
||||
\fBnot\fP exist that can support the sort operation, the results must
|
||||
be \fIless than\fP 32 megabytes.
|
||||
.sp
|
||||
Use \fI\%\-\-sort\fP conjunction with \fI\%\-\-skip\fP and
|
||||
\fI\%\-\-limit\fP to limit number of exported documents.
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
mongoexport \-d test \-c records \-\-sort \(aq{a: 1}\(aq \-\-limit 100 \-\-out export.0.json
|
||||
mongoexport \-d test \-c records \-\-sort \(aq{a: 1}\(aq \-\-limit 100 \-\-skip 100 \-\-out export.1.json
|
||||
mongoexport \-d test \-c records \-\-sort \(aq{a: 1}\(aq \-\-limit 100 \-\-skip 200 \-\-out export.2.json
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
See \fBsort()\fP for information about the underlying
|
||||
operation.
|
||||
.UNINDENT
|
||||
.SH USE
|
||||
.SS Export in CSV Format
|
||||
.sp
|
||||
In the following example, \fBmongoexport\fP exports the
|
||||
collection \fBcontacts\fP from the \fBusers\fP database from the
|
||||
@ -403,6 +509,7 @@ mongoexport \-\-db users \-\-collection contacts \-\-csv \-\-fieldFile fields.tx
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SS Export in JSON Format
|
||||
.sp
|
||||
The next example creates an export of the collection \fBcontacts\fP
|
||||
from the MongoDB instance running on the localhost port number \fB27017\fP,
|
||||
@ -418,6 +525,7 @@ mongoexport \-\-db sales \-\-collection contacts \-\-out contacts.json \-\-journ
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SS Export Collection Directly From Data Files
|
||||
.sp
|
||||
The following example exports the collection \fBcontacts\fP from the
|
||||
\fBsales\fP database located in the MongoDB data files located at
|
||||
@ -442,12 +550,12 @@ connected to the data files located in the \fB/srv/mongodb/\fP
|
||||
directory.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SS Export from Remote Host Running with Authentication
|
||||
.sp
|
||||
The final example exports the collection \fBcontacts\fP from the
|
||||
The following example exports the collection \fBcontacts\fP from the
|
||||
database \fBmarketing\fP . This data resides on the MongoDB instance
|
||||
located on the host \fBmongodb1.example.net\fP running on port
|
||||
\fB37017\fP, which requires the username \fBuser\fP and the password
|
||||
\fBpass\fP\&.
|
||||
located on the host \fBmongodb1.example.net\fP running on port \fB37017\fP,
|
||||
which requires the username \fBuser\fP and the password \fBpass\fP\&.
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -458,9 +566,69 @@ mongoexport \-\-host mongodb1.example.net \-\-port 37017 \-\-username user \-\-p
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH TYPE FIDELITY
|
||||
.sp
|
||||
\fBWARNING:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
\fBmongoimport\fP and \fBmongoexport\fP do not reliably
|
||||
preserve all rich \fIBSON\fP data types because \fIJSON\fP can
|
||||
only represent a subset of the types supported by BSON. As a result,
|
||||
data exported or imported with these tools may lose some measure of
|
||||
fidelity. See http://docs.mongodb.org/manual/reference/mongodb\-extended\-json for more
|
||||
information.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
JSON can only represent a subset of the types supported by BSON. To
|
||||
preserve type information, \fBmongoexport\fP uses the \fBstrict
|
||||
mode representation\fP for certain
|
||||
types.
|
||||
.sp
|
||||
For example, the following insert operation in the \fBmongo\fP
|
||||
shell uses the \fBmongoShell mode representation\fP for the BSON types
|
||||
\fBdata_date\fP and \fBdata_numberlong\fP:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
use test
|
||||
db.traffic.insert( { _id: 1, volume: NumberLong(2980000), date: new Date() } )
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Use \fBmongoexport\fP to export the data:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
mongoexport \-\-db test \-\-collection traffic \-\-out traffic.json
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
The exported data is in \fBstrict mode representation\fP to preserve type information:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
{ "_id" : 1, "volume" : { "$numberLong" : "2980000" }, "date" : { "$date" : "2014\-03\-13T13:47:42.483\-0400" } }
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/reference/mongodb\-extended\-json for a complete list of
|
||||
these types and the representations used.
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
274
debian/mongofiles.1
vendored
274
debian/mongofiles.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOFILES" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOFILES" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongofiles \- MongoDB
|
||||
mongofiles \- MongoDB GridFS Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -82,90 +82,175 @@ For \fIreplica sets\fP,
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongofiles\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongofiles\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongofiles\fP utility.
|
||||
Returns the \fBmongofiles\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP that
|
||||
holds your GridFS system. By default \fBmongofiles\fP attempts
|
||||
to connect to a MongoDB process ruining on the localhost port
|
||||
number \fB27017\fP\&.
|
||||
Specifies a resolvable hostname for the \fBmongod\fP that holds
|
||||
your GridFS system. By default \fBmongofiles\fP attempts to connect
|
||||
to a MongoDB process running on the localhost port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than 27017.
|
||||
Optionally, specify a port number to connect a MongoDB instance running
|
||||
on a port other than 27017.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running on
|
||||
the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fImongofiles \-\-host\fP command.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongofiles\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongofiles\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongofiles\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongofiles\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongofiles\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongofiles is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongofiles does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongofiles\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if your
|
||||
database requires authentication. Use in conjunction with the
|
||||
\fImongofiles \-\-password\fP option to supply a password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fImongofiles \-\-username\fP option to
|
||||
supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and
|
||||
do not pass an argument to \fI\-\-password\fP,
|
||||
\fBmongofiles\fP will prompt for a password interactively. If
|
||||
you do not specify a password on the command line,
|
||||
\fI\-\-password\fP must be the last argument specified.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongofiles\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongofiles\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongofiles\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -173,17 +258,10 @@ you do not specify a password on the command line,
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongofiles\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongofiles\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -191,82 +269,76 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongofiles\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongofiles\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies the directory of the MongoDB data files. If used, the
|
||||
\fI\-\-dbpath\fP option enables \fBmongofiles\fP to attach directly to
|
||||
local data files interact with the GridFS data without the
|
||||
\fBmongod\fP\&. To run with \fI\-\-dbpath\fP, \fBmongofiles\fP needs to lock
|
||||
access to the data directory: as a result, no \fBmongod\fP can access
|
||||
the same path while the process runs.
|
||||
\fI\-\-dbpath\fP option enables \fBmongofiles\fP to attach directly to local data
|
||||
files without a running \fBmongod\fP\&. When run with \fI\-\-dbpath\fP,
|
||||
\fBmongofiles\fP locks access to the data directory. No \fBmongod\fP can
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\-\-directoryperdb\fP in conjunction with the corresponding
|
||||
option to \fBmongod\fP, which allows \fBmongofiles\fP when
|
||||
running with the \fI\-\-dbpath\fP option and MongoDB uses an
|
||||
on\-disk format where every database has a distinct
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongofiles\fP to access data from MongoDB
|
||||
instances that use an on\-disk format where every database has a distinct
|
||||
directory. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongofiles\fP operations to use the durability
|
||||
\fIjournal\fP when running with \fI\-\-dbpath\fP
|
||||
to ensure that the database maintains a recoverable state. This
|
||||
forces \fBmongofiles\fP to record all data on disk regularly.
|
||||
Allows \fBmongofiles\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-db <db>, \-d <db>
|
||||
Use the \fI\-\-db\fP option to specify the MongoDB database that stores
|
||||
or will store the GridFS files.
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies the name of the database on which to run \fBmongofiles\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c <collection>
|
||||
.B \-\-collection <collection>, \-c
|
||||
This option has no use in this context and a future release may
|
||||
remove it. See \fI\%SERVER-4931\fP for more information.
|
||||
remove it. See \fI\%SERVER\-4931\fP for more information.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-local <filename>, \-l <filename>
|
||||
.B \-\-local <filename>, \-l
|
||||
Specifies the local filesystem name of a file for get and put
|
||||
operations.
|
||||
.sp
|
||||
In the \fBmongofiles put\fP and \fBmongofiles get\fP
|
||||
commands the required \fB<filename>\fP modifier refers to the name
|
||||
the object will have in GridFS. \fBmongofiles\fP assumes that
|
||||
this reflects the file\(aqs name on the local file
|
||||
system. This setting overrides this default.
|
||||
In the \fBmongofiles put\fP and \fBmongofiles get\fP commands,
|
||||
the required \fB<filename>\fP modifier refers to the name the object will
|
||||
have in GridFS. \fBmongofiles\fP assumes that this reflects the
|
||||
file\(aqs name on the local file system. This setting overrides this
|
||||
default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-type <MIME>, t <MIME>
|
||||
Provides the ability to specify a \fIMIME\fP type to describe the
|
||||
file inserted into GridFS storage. \fBmongofiles\fP omits this
|
||||
option in the default operation.
|
||||
.B \-\-type <MIME>
|
||||
Provides the ability to specify a \fIMIME\fP type to describe the file
|
||||
inserted into GridFS storage. \fBmongofiles\fP omits this option in
|
||||
the default operation.
|
||||
.sp
|
||||
Use only with \fBmongofiles put\fP operations.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-replace, \-r
|
||||
Alters the behavior of \fBmongofiles put\fP to replace
|
||||
existing GridFS objects with the specified local file, rather than
|
||||
adding an additional object with the same name.
|
||||
Alters the behavior of \fBmongofiles put\fP to replace existing
|
||||
GridFS objects with the specified local file, rather than adding an
|
||||
additional object with the same name.
|
||||
.sp
|
||||
In the default operation, files will not be overwritten by a
|
||||
\fBmongofiles put\fP option.
|
||||
@ -415,6 +487,6 @@ mongofiles \-d records get 32\-corinth.lp
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
383
debian/mongoimport.1
vendored
383
debian/mongoimport.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOIMPORT" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOIMPORT" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongoimport \- MongoDB
|
||||
mongoimport \- MongoDB Import Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -38,18 +38,14 @@ potentially, another third\-party export tool. See the
|
||||
http://docs.mongodb.org/manual/core/import\-export document for a more in depth
|
||||
usage overview, and the \fBmongoexport\fP document for more
|
||||
information regarding \fBmongoexport\fP, which
|
||||
provides the inverse "importing" capability.
|
||||
provides the inverse "exporting" capability.
|
||||
.SH CONSIDERATIONS
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
Do not use \fBmongoimport\fP and \fBmongoexport\fP for
|
||||
full instance, production backups because they will not reliably capture data type
|
||||
information. Use \fBmongodump\fP and \fBmongorestore\fP as
|
||||
described in http://docs.mongodb.org/manual/core/backups for this kind of
|
||||
functionality.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH OPTIONS
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -61,43 +57,52 @@ functionality.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongoimport\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongoimport\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongoimport\fP program.
|
||||
Returns the \fBmongoimport\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which
|
||||
you want to restore the database. By default \fBmongoimport\fP
|
||||
will attempt to connect to a MongoDB process ruining on the
|
||||
localhost port numbered \fB27017\fP\&.
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongoimport\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, use the \fI\-\-host\fP argument with a
|
||||
setname, followed by a slash and a comma\-separated list of host and
|
||||
port names. \fBmongoimport\fP will, given the seed of at least
|
||||
one connected set member, connect to the \fIprimary\fP of that set. This
|
||||
option would resemble:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
\-\-host repl0/mongo0.example.net,mongo0.example.net:27018,mongo1.example.net,mongo2.example.net
|
||||
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
@ -109,61 +114,131 @@ specifying the host and port number directly.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running on
|
||||
the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fImongoimport \-\-host\fP command.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongoimport\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongoimport\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongoimport\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongoimport\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongoimport\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongoimport is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongoimport does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongoimport\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if your
|
||||
database requires authentication. Use in conjunction with the
|
||||
\fImongoimport \-\-password\fP option to supply a password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fImongoimport \-\-username\fP option to
|
||||
supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and
|
||||
do not pass an argument to \fI\-\-password\fP,
|
||||
\fBmongoimport\fP will prompt for a password interactively. If
|
||||
you do not specify a password on the command line,
|
||||
\fI\-\-password\fP must be the last option.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongoimport\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongoimport\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongoimport\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -171,17 +246,10 @@ you do not specify a password on the command line,
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongoimport\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongoimport\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -189,107 +257,102 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongoimport\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongoimport\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies the directory of the MongoDB data files. If used, the
|
||||
\fI\-\-dbpath\fP option enables
|
||||
\fBmongoimport\fP to attach directly to local data files and
|
||||
insert the data without the \fBmongod\fP\&. To run with
|
||||
\fB\-\-dbpath\fP, \fBmongoimport\fP needs to lock access to the
|
||||
data directory: as a result, no \fBmongod\fP can access the
|
||||
same path while the process runs.
|
||||
\fI\-\-dbpath\fP option enables \fBmongoimport\fP to attach directly to local data
|
||||
files without a running \fBmongod\fP\&. When run with \fI\-\-dbpath\fP,
|
||||
\fBmongoimport\fP locks access to the data directory. No \fBmongod\fP can
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\-\-directoryperdb\fP in conjunction with the
|
||||
corresponding option to \fBmongod\fP, which allows
|
||||
\fBmongoimport\fP to import data into MongoDB instances that
|
||||
have every database\(aqs files saved in discrete directories on the
|
||||
disk. This option is only relevant when specifying the
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongoimport\fP to access data from MongoDB
|
||||
instances that use an on\-disk format where every database has a distinct
|
||||
directory. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongoexport\fP write to the durability
|
||||
\fIjournal\fP to ensure that the data files will remain in a
|
||||
consistent state during the write process. This option is only
|
||||
Allows \fBmongoimport\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-db <db>, \-d <db>
|
||||
Use the \fI\-\-db\fP option to specify a database for
|
||||
\fBmongoimport\fP to import data.
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies the name of the database on which to run \fBmongoimport\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c <collection>
|
||||
Use the \fI\-\-collection\fP option to specify a collection for
|
||||
\fBmongoimport\fP to import.
|
||||
.B \-\-collection <collection>, \-c
|
||||
Specifies the collection to import.
|
||||
.sp
|
||||
New in version 2.6: If you do not specify \fI\-\-collection\fP,
|
||||
\fBmongoimport\fP takes the collection name from the input
|
||||
filename. MongoDB omits the extension of the file from the
|
||||
collection name, if the input file has an extension.
|
||||
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-fields <field1<,field2>>, \-f <field1[,field2]>
|
||||
Specify a comma separated list of field names when importing
|
||||
\fIcsv\fP or \fItsv\fP files that do not have field names in
|
||||
the first (i.e. header) line of the file.
|
||||
.B \-\-fields <field1[,field2]>, \-f
|
||||
Specify a comma separated list of field names when importing \fIcsv\fP
|
||||
or \fItsv\fP files that do not have field names in the first (i.e.
|
||||
header) line of the file.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-fieldFile <filename>
|
||||
As an alternative to \fI\%--fields\fP the \fI\%--fieldFile\fP
|
||||
option allows you to specify a file (e.g. \fB<file>\fP) to that
|
||||
holds a list of field names if your \fIcsv\fP or \fItsv\fP
|
||||
file does not include field names in the first (i.e. header) line
|
||||
of the file. Place one field per line.
|
||||
As an alternative to \fI\%\-\-fields\fP, the \fI\%\-\-fieldFile\fP
|
||||
option allows you to specify a file that holds a list of field names if
|
||||
your \fIcsv\fP or \fItsv\fP file does not include field names in the
|
||||
first line of the file (i.e. header). Place one field per line.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ignoreBlanks
|
||||
In \fIcsv\fP and \fItsv\fP exports, ignore empty fields. If not
|
||||
Ignores empty fields in \fIcsv\fP and \fItsv\fP exports. If not
|
||||
specified, \fBmongoimport\fP creates fields without values in
|
||||
imported documents.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-type <json|csv|tsv>
|
||||
Declare the type of export format to import. The default format is
|
||||
\fIJSON\fP, but it\(aqs possible to import \fIcsv\fP and
|
||||
\fItsv\fP files.
|
||||
Specifies the file type to import. The default format is \fIJSON\fP,
|
||||
but it\(aqs possible to import \fIcsv\fP and \fItsv\fP files.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-file <filename>
|
||||
Specify the location of a file containing the data to
|
||||
import. \fBmongoimport\fP will read data from standard input
|
||||
(e.g. "stdin.") if you do not specify a file.
|
||||
Specifies the location and name of a file containing the data to import.
|
||||
If you do not specify a file, \fBmongoimport\fP reads data from
|
||||
standard input (e.g. "stdin").
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-drop
|
||||
Modifies the import process so that the target instance
|
||||
drops every collection before importing the collection from the
|
||||
input.
|
||||
Modifies the import process so that the target instance drops
|
||||
every collection before importing the collection from the input.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-headerline
|
||||
If using "\fI\-\-type csv\fP" or
|
||||
"\fI\-\-type tsv\fP," use the first line as
|
||||
field names. Otherwise, \fBmongoimport\fP will import the first
|
||||
line as a distinct document.
|
||||
If using \fI\-\-type csv\fP or \fI\-\-type
|
||||
tsv\fP, uses the first line as field names.
|
||||
Otherwise, \fBmongoimport\fP will import the first line as a
|
||||
distinct document.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -299,7 +362,7 @@ database if they match an imported object, while inserting all
|
||||
other objects.
|
||||
.sp
|
||||
If you do not specify a field or fields using the
|
||||
\fI\%--upsertFields\fP \fBmongoimport\fP will upsert on the
|
||||
\fI\%\-\-upsertFields\fP \fBmongoimport\fP will upsert on the
|
||||
basis of the \fB_id\fP field.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
@ -326,17 +389,14 @@ first error rather than continuing the operation despite errors.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-jsonArray
|
||||
Changed in version 2.2: The limit on document size increased from 4MB to 16MB.
|
||||
|
||||
.sp
|
||||
Accept import of data expressed with multiple MongoDB documents
|
||||
Accepts the import of data expressed with multiple MongoDB documents
|
||||
within a single \fIJSON\fP array.
|
||||
.sp
|
||||
Use in conjunction with \fImongoexport \-\-jsonArray\fP to
|
||||
Used in conjunction with \fImongoexport \-\-jsonArray\fP to
|
||||
import data written as a single \fIJSON\fP array. Limited to
|
||||
imports of 16 MB or smaller.
|
||||
.UNINDENT
|
||||
.SH USAGE
|
||||
.SH USE
|
||||
.sp
|
||||
In this example, \fBmongoimport\fP imports the \fIcsv\fP
|
||||
formatted data in the \fB/opt/backups/contacts.csv\fP into the
|
||||
@ -353,10 +413,25 @@ mongoimport \-\-db users \-\-collection contacts \-\-type csv \-\-file /opt/back
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Since \fBmongoimport\fP uses the input file name (minus the
|
||||
extension) as the collection name if \fB\-c\fP or \fB\-\-collection\fP is
|
||||
unspecified, the following example is equivalent to the previous
|
||||
example:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
mongoimport \-\-db users \-\-type csv \-\-file /opt/backups/contacts.csv
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
In the following example, \fBmongoimport\fP imports the data in
|
||||
the \fIJSON\fP formatted file \fBcontacts.json\fP into the collection
|
||||
\fBcontacts\fP on the MongoDB instance running on the localhost port
|
||||
number 27017. Journaling is explicitly enabled.
|
||||
number 27017.
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -370,7 +445,6 @@ mongoimport \-\-collection contacts \-\-file contacts.json
|
||||
.sp
|
||||
In the next example, \fBmongoimport\fP takes data passed to it on
|
||||
standard input (i.e. with a \fB|\fP pipe.) and imports it into the
|
||||
collection \fBcontacts\fP in the \fBsales\fP database is the
|
||||
MongoDB datafiles located at \fB/srv/mongodb/\fP\&. if the import process
|
||||
encounters an error, the \fBmongoimport\fP will halt because of
|
||||
the \fI\-\-stopOnError\fP option.
|
||||
@ -402,9 +476,48 @@ mongoimport \-\-host mongodb1.example.net \-\-port 37017 \-\-username user \-\-p
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.SH TYPE FIDELITY
|
||||
.sp
|
||||
\fBWARNING:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
\fBmongoimport\fP and \fBmongoexport\fP do not reliably
|
||||
preserve all rich \fIBSON\fP data types because \fIJSON\fP can
|
||||
only represent a subset of the types supported by BSON. As a result,
|
||||
data exported or imported with these tools may lose some measure of
|
||||
fidelity. See http://docs.mongodb.org/manual/reference/mongodb\-extended\-json for more
|
||||
information.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
JSON can only represent a subset of the types supported by BSON. To
|
||||
preserve type information, \fBmongoimport\fP accepts \fBstrict
|
||||
mode representation\fP for certain
|
||||
types.
|
||||
.sp
|
||||
For example, to preserve type information for BSON types
|
||||
\fBdata_date\fP and \fBdata_numberlong\fP during
|
||||
\fBmongoimport\fP, the data should be in strict mode
|
||||
representation, as in the following:
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
.nf
|
||||
.ft C
|
||||
{ "_id" : 1, "volume" : { "$numberLong" : "2980000" }, "date" : { "$date" : "2014\-03\-13T13:47:42.483\-0400" } }
|
||||
.ft P
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
For the \fBdata_numberlong\fP type, \fBmongoimport\fP
|
||||
converts into a float during the import.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/reference/mongodb\-extended\-json for a complete list of
|
||||
these types and the representations used.
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
309
debian/mongooplog.1
vendored
309
debian/mongooplog.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOOPLOG" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOOPLOG" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongooplog \- MongoDB
|
||||
mongooplog \- MongoDB Oplog Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -88,39 +88,49 @@ http://docs.mongodb.org/manual/core/backups, http://docs.mongodb.org/manual/core
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongooplog\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including the
|
||||
option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongooplog\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongooplog\fP utility.
|
||||
Returns the \fBmongooplog\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP instance
|
||||
to which \fBmongooplog\fP will apply \fIoplog\fP operations
|
||||
retrieved from the serve specified by the \fI\-\-from\fP
|
||||
option.
|
||||
Specifies a resolvable hostname for the \fBmongod\fP instance to
|
||||
which \fBmongooplog\fP will apply \fIoplog\fP operations
|
||||
retrieved from the server specified by the \fI\-\-from\fP option.
|
||||
.sp
|
||||
\fBmongooplog\fP assumes that all target \fBmongod\fP
|
||||
instances are accessible by way of port \fB27017\fP\&. You may,
|
||||
optionally, declare an alternate port number as part of the
|
||||
hostname argument.
|
||||
By default \fBmongooplog\fP attempts to connect to a MongoDB instance running
|
||||
on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
You can always connect directly to a single \fBmongod\fP
|
||||
instance by specifying the host and port number directly.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -131,68 +141,140 @@ name, and a seed list of set members, in the following format:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can always connect directly to a single MongoDB instance by
|
||||
specifying the host and port number directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port
|
||||
Specifies the port number of the \fBmongod\fP instance where
|
||||
\fBmongooplog\fP will apply \fIoplog\fP entries. Only
|
||||
specify this option if the MongoDB instance that you wish to
|
||||
connect to is not running on the standard port. (i.e. \fB27017\fP)
|
||||
You may also specify a port number using the \fI\-\-host\fP command.
|
||||
\fBmongooplog\fP will apply \fIoplog\fP entries. Specify
|
||||
this option only if the MongoDB instance to connect to is not
|
||||
running on the standard port of \fB27017\fP\&. You may also specify a
|
||||
port number using the \fI\-\-host\fP command.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongooplog\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongooplog\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongooplog\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongooplog\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongooplog\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongooplog is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongooplog does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongooplog\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if
|
||||
your database requires authentication. Use in conjunction with the
|
||||
\fI\-\-password\fP option to supply a
|
||||
password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fI\-\-username\fP
|
||||
option to supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and
|
||||
do not pass an argument to \fI\-\-password\fP,
|
||||
\fBmongooplog\fP will prompt for a password interactively. If
|
||||
you do not specify a password on the command line,
|
||||
\fI\-\-password\fP must be the last option.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongooplog\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongooplog\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongooplog\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -200,17 +282,10 @@ you do not specify a password on the command line,
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongooplog\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongooplog\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -218,79 +293,84 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongooplog\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongooplog\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies a directory, containing MongoDB data files, to which
|
||||
\fBmongooplog\fP will apply operations from the \fIoplog\fP
|
||||
of the database specified with the \fI\-\-from\fP
|
||||
option. When used, the \fI\-\-dbpath\fP option enables
|
||||
\fBmongo\fP to attach directly to local data files and write
|
||||
data without a running \fBmongod\fP instance. To run with
|
||||
\fI\-\-dbpath\fP, \fBmongooplog\fP needs to restrict access
|
||||
to the data directory: as a result, no \fBmongod\fP can be
|
||||
\fBmongooplog\fP will apply operations from the \fIoplog\fP of
|
||||
the database specified with the \fI\-\-from\fP
|
||||
option.
|
||||
.sp
|
||||
When used, the \fI\-\-dbpath\fP option enables \fBmongo\fP to
|
||||
attach directly to local data files and write data without a running
|
||||
\fBmongod\fP instance.
|
||||
.sp
|
||||
To run with \fI\-\-dbpath\fP, \fBmongooplog\fP needs to restrict
|
||||
access to the data directory: as a result, no \fBmongod\fP can be
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\-\-directoryperdb\fP in conjunction with the
|
||||
corresponding option to \fBmongod\fP\&. This option allows
|
||||
\fBmongooplog\fP to write to data files organized with each
|
||||
database located in a distinct directory. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongooplog\fP to access data from MongoDB
|
||||
instances that use an on\-disk format where every database has a distinct
|
||||
directory. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongooplog\fP operations to use the durability
|
||||
\fIjournal\fP to ensure that the data files will
|
||||
remain in a consistent state during the writing process. This
|
||||
option is only relevant when specifying the \fI\-\-dbpath\fP
|
||||
option.
|
||||
Allows \fBmongooplog\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-seconds <number>, \-s <number>
|
||||
Specify a number of seconds of operations for \fBmongooplog\fP
|
||||
to pull from the \fIremote host\fP\&. Unless
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies the name of the database on which to run \fBmongooplog\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c
|
||||
Specifies the collection to export.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-seconds <number>, \-s
|
||||
Specify a number of seconds of operations for \fBmongooplog\fP to
|
||||
pull from the \fIremote host\fP\&. Unless
|
||||
specified the default value is \fB86400\fP seconds, or 24 hours.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-from <host[:port]>
|
||||
Specify the host for \fBmongooplog\fP to retrieve \fIoplog\fP
|
||||
operations from. \fBmongooplog\fP \fIrequires\fP this
|
||||
option.
|
||||
operations from. \fBmongooplog\fP \fIrequires\fP this option.
|
||||
.sp
|
||||
Unless you specify the \fI\-\-host\fP option,
|
||||
\fBmongooplog\fP will apply the operations collected with this
|
||||
option to the oplog of the \fBmongod\fP instance running on
|
||||
the localhost interface connected to port \fB27017\fP\&.
|
||||
option to the oplog of the \fBmongod\fP instance running on the
|
||||
localhost interface connected to port \fB27017\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-oplogns <namespace>
|
||||
Specify a namespace in the \fI\-\-from\fP
|
||||
host where the oplog resides. The default value is
|
||||
\fBlocal.oplog.rs\fP, which is the where \fIreplica set\fP members
|
||||
store their operation log. However, if you\(aqve copied \fIoplog\fP
|
||||
entries into another database or collection, use this option to
|
||||
copy oplog entries stored in another location.
|
||||
.sp
|
||||
\fINamespaces\fP take the form of
|
||||
\fB[database].[collection]\fP\&.
|
||||
Specify a namespace in the \fI\-\-from\fP host
|
||||
where the oplog resides. The default value is \fBlocal.oplog.rs\fP, which
|
||||
is the where \fIreplica set\fP members store their operation log.
|
||||
However, if you\(aqve copied \fIoplog\fP entries into another database or
|
||||
collection, use this option to copy oplog entries stored in another
|
||||
location. Namespaces take the form of \fB[database].[collection]\fP\&.
|
||||
.UNINDENT
|
||||
.SS Usage
|
||||
.SH USE
|
||||
.sp
|
||||
Consider the following prototype \fBmongooplog\fP command:
|
||||
.INDENT 0.0
|
||||
@ -354,11 +434,10 @@ Here, \fBmongooplog\fP imports \fIoplog\fP operations from the
|
||||
\fBmongod\fP host connected to port \fB27017\fP\&. This migrates
|
||||
operations to the MongoDB data files stored in the \fB/srv/mongodb\fP
|
||||
directory. Additionally \fBmongooplog\fP will use the durability
|
||||
\fIjournal\fP to ensure that the data files remain in a consistent
|
||||
state.
|
||||
\fIjournal\fP to ensure that the data files remain valid.
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
12
debian/mongoperf.1
vendored
12
debian/mongoperf.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOPERF" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOPERF" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongoperf \- MongoDB
|
||||
mongoperf \- MongoDB Performance Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -69,10 +69,8 @@ Specify options to \fBmongoperf\fP using a JavaScript document.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Displays the options to \fBmongoperf\fP\&. Specify options to
|
||||
\fBmongoperf\fP with a JSON document described in the
|
||||
\fI\%Configuration Fields\fP section.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongoperf\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -280,6 +278,6 @@ iostat \-xm 2
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
418
debian/mongorestore.1
vendored
418
debian/mongorestore.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGORESTORE" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGORESTORE" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongorestore \- MongoDB
|
||||
mongorestore \- MongoDB Data Restoration Tool
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -40,6 +40,7 @@ data to an existing database.
|
||||
\fBmongorestore\fP can write data to either \fImongod\fP or \fBmongos\fP
|
||||
instances, in addition to writing directly to MongoDB data files
|
||||
without an active \fBmongod\fP\&.
|
||||
.SH BEHAVIOR
|
||||
.sp
|
||||
If you restore to an existing database, \fBmongorestore\fP will
|
||||
only insert into the existing database, and does not perform updates
|
||||
@ -64,14 +65,29 @@ during a restore operation, but \fBmongorestore\fP will not
|
||||
receive errors.
|
||||
.UNINDENT
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 0.0
|
||||
.INDENT 3.5
|
||||
The format of data created by \fBmongodump\fP tool from the
|
||||
2.2 distribution or later is different and incompatible with
|
||||
earlier versions of \fBmongod\fP\&.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
The data format used by \fBmongodump\fP from version 2.2 or
|
||||
later is \fIincompatible\fP with earlier versions of \fBmongod\fP\&.
|
||||
Do not use recent versions of \fBmongodump\fP to back up older
|
||||
data stores.
|
||||
.SH REQUIRED ACCESS TO RESTORE USER DATA
|
||||
.sp
|
||||
Changed in version 2.6.
|
||||
|
||||
.sp
|
||||
To restore users and \fIuser\-defined roles\fP on a
|
||||
given database, you must have access to the \fBadmin\fP database. MongoDB
|
||||
stores the user data and role definitions for all databases in the
|
||||
\fBadmin\fP database.
|
||||
.sp
|
||||
Specifically, to restore users to a given database, you must have the
|
||||
\fBinsert\fP \fIaction\fP on the \fBadmin\fP
|
||||
database\(aqs \fBadmin.system.users\fP collection. The \fBrestore\fP
|
||||
role provides this privilege.
|
||||
.sp
|
||||
To restore user\-defined roles to a database, you must have the
|
||||
\fBinsert\fP action on the \fBadmin\fP database\(aqs
|
||||
\fBadmin.system.roles\fP collection. The \fBrestore\fP role
|
||||
provides this privilege.
|
||||
.SH OPTIONS
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -83,35 +99,46 @@ earlier versions of \fBmongod\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongorestore\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times (e.g. \fB\-vvvvv\fP).
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongorestore\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongorestore\fP tool.
|
||||
Returns the \fBmongorestore\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which
|
||||
you want to restore the database. By default
|
||||
\fBmongorestore\fP will attempt to connect to a MongoDB
|
||||
process running on the localhost port number \fB27017\fP\&. For an
|
||||
example of \fI\-\-host\fP, see \fIbackup\-restore\-dump\fP\&.
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongorestore\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -122,69 +149,138 @@ name, and a seed list of set members, in the following format:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can always connect directly to a single MongoDB instance by
|
||||
specifying the host and port number directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running
|
||||
on the standard port (i.e. \fB27017\fP). You may also specify a port
|
||||
number using the \fI\-\-host\fP command. For
|
||||
an example of \fI\-\-port\fP, see \fIbackup\-restore\-dump\fP\&.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongorestore\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongorestore\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongorestore\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongorestore\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongorestore\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongorestore is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongorestore does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongorestore\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if
|
||||
your database requires authentication. Use in conjunction with the
|
||||
\fI\-\-password\fP option to supply a
|
||||
password. For an example of \fI\-\-username\fP, see
|
||||
\fIbackup\-restore\-dump\fP\&.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fI\-\-username\fP option to
|
||||
supply a username. For an example of \fI\-\-password\fP, see
|
||||
\fIbackup\-restore\-dump\fP\&.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and do not pass an argument
|
||||
to \fI\-\-password\fP, \fBmongorestore\fP will prompt for a
|
||||
password interactively. If you do not specify a password on the
|
||||
command line, \fI\-\-password\fP must be the last argument
|
||||
specified.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongorestore\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongorestore\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongorestore\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -192,17 +288,10 @@ specified.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongorestore\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongorestore\fP assumes
|
||||
that the database specified as the argument to the \fI\%\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -210,81 +299,70 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongorestore\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongorestore\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-dbpath <path>
|
||||
Specifies the directory of the MongoDB data files. If used, the
|
||||
\fI\-\-dbpath\fP option enables \fBmongorestore\fP to attach
|
||||
directly to local data files and insert the data without the
|
||||
\fBmongod\fP\&. To run with \fI\-\-dbpath\fP,
|
||||
\fBmongorestore\fP needs to lock access to the data directory:
|
||||
as a result, no \fBmongod\fP can access the same path while the
|
||||
process runs. For an example of \fI\-\-dbpath\fP, see
|
||||
\fIbackup\-restore\-dbpath\fP\&.
|
||||
\fI\%\-\-dbpath\fP option enables \fBmongorestore\fP to attach directly to local data
|
||||
files without a running \fBmongod\fP\&. When run with \fI\%\-\-dbpath\fP,
|
||||
\fBmongorestore\fP locks access to the data directory. No \fBmongod\fP can
|
||||
access the same path while the process runs.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-directoryperdb
|
||||
Use the \fI\-\-directoryperdb\fP in conjunction with the
|
||||
corresponding option to \fBmongod\fP, which allows
|
||||
\fBmongorestore\fP to import data into MongoDB instances that
|
||||
have every database\(aqs files saved in discrete directories on the
|
||||
disk. This option is only relevant when specifying the
|
||||
\fI\-\-dbpath\fP option.
|
||||
When used in conjunction with the corresponding option in
|
||||
\fBmongod\fP, allows \fBmongorestore\fP to access data from MongoDB
|
||||
instances that use an on\-disk format where every database has a distinct
|
||||
directory. This option is only relevant when specifying the
|
||||
\fI\%\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-journal
|
||||
Allows \fBmongorestore\fP write to the durability
|
||||
\fIjournal\fP to ensure that the data files will remain in a
|
||||
consistent state during the write process. This option is only
|
||||
relevant when specifying the \fI\-\-dbpath\fP option. For an
|
||||
example of \fI\-\-journal\fP, see \fIbackup\-restore\-dbpath\fP\&.
|
||||
Allows \fBmongorestore\fP operations to use the durability \fIjournal\fP to
|
||||
ensure data files remain valid and recoverable. This option is only
|
||||
relevant when specifying the \fI\%\-\-dbpath\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-db <db>, \-d <db>
|
||||
Use the \fI\-\-db\fP option to specify a database for
|
||||
\fBmongorestore\fP to restore data \fIinto\fP\&. If the database
|
||||
doesn\(aqt exist, \fBmongorestore\fP will create the specified
|
||||
database. If you do not specify a \fB<db>\fP,
|
||||
\fBmongorestore\fP creates new databases that correspond to
|
||||
the databases where data originated and data may be
|
||||
overwritten. Use this option to restore data into a MongoDB
|
||||
instance that already has data.
|
||||
.B \-\-db <database>, \-d
|
||||
Specifies a database for \fBmongorestore\fP to restore data \fIinto\fP\&.
|
||||
If the database does not exist, \fBmongorestore\fP creates the
|
||||
database. If you do not specify a \fB<db>\fP, \fBmongorestore\fP
|
||||
creates new databases that correspond to the databases where data
|
||||
originated and data may be overwritten. Use this option to restore data
|
||||
into a MongoDB instance that already has data.
|
||||
.sp
|
||||
\fI\-\-db\fP does \fInot\fP control which \fIBSON\fP files
|
||||
\fI\%\-\-db\fP does \fInot\fP control which \fIBSON\fP files
|
||||
\fBmongorestore\fP restores. You must use the
|
||||
\fBmongorestore\fP \fI\%path option\fP to limit that restored data.
|
||||
\fBmongorestore\fP \fI\%path option\fP to
|
||||
limit that restored data.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-collection <collection>, \-c <collection>
|
||||
Use the \fI\-\-collection\fP option to specify a collection for
|
||||
\fBmongorestore\fP to restore. If you do not specify a
|
||||
\fB<collection>\fP, \fBmongorestore\fP imports all collections
|
||||
created. Existing data may be overwritten. Use this option to
|
||||
restore data into a MongoDB instance that already has data, or to
|
||||
restore only some data in the specified imported data set.
|
||||
.B \-\-collection <collection>, \-c
|
||||
Specifies a single collection for \fBmongorestore\fP to restore. If
|
||||
you do not specify \fI\%\-\-collection\fP, \fBmongorestore\fP takes
|
||||
the collection name from the input filename. If the input file has an
|
||||
extension, MongoDB omits the extension of the file from the collection
|
||||
name.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-objcheck
|
||||
Forces the \fBmongorestore\fP to validate all requests from
|
||||
clients upon receipt to ensure that clients never insert invalid
|
||||
documents into the database. For objects with a high degree of
|
||||
sub\-document nesting, \fI\-\-objcheck\fP can have a small impact
|
||||
on performance. You can set \fI\%--noobjcheck\fP to disable
|
||||
object checking at run\-time.
|
||||
Forces \fBmongorestore\fP to validate all requests from clients
|
||||
upon receipt to ensure that clients never insert invalid documents into
|
||||
the database. For objects with a high degree of sub\-document nesting,
|
||||
\fI\-\-objcheck\fP can have a small impact on performance. You can set
|
||||
\fI\%\-\-noobjcheck\fP to disable object checking at run\-time.
|
||||
.sp
|
||||
Changed in version 2.4: MongoDB enables \fI\-\-objcheck\fP by default, to prevent any
|
||||
client from inserting malformed or invalid BSON into a MongoDB
|
||||
@ -302,27 +380,41 @@ incoming BSON documents.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-filter \(aq<JSON>\(aq
|
||||
Limits the documents that \fBmongorestore\fP imports to only
|
||||
those documents that match the JSON document specified as
|
||||
\fB\(aq<JSON>\(aq\fP\&. Be sure to include the document in single quotes to
|
||||
avoid interaction with your system\(aqs shell environment. For an
|
||||
example of \fI\%--filter\fP, see \fIbackup\-restore\-filter\fP\&.
|
||||
.B \-\-filter <JSON>
|
||||
Limits the documents that \fBmongorestore\fP imports to only those
|
||||
documents that match the JSON document specified as \fB\(aq<JSON>\(aq\fP\&. Be
|
||||
sure to include the document in single quotes to avoid interaction with
|
||||
your system\(aqs shell environment. For an example of \fI\%\-\-filter\fP,
|
||||
see \fIbackup\-restore\-filter\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-drop
|
||||
Modifies the restoration procedure to drop every collection from
|
||||
the target database before restoring the collection from the dumped
|
||||
backup.
|
||||
Modifies the restoration procedure to drop every collection from the
|
||||
target database before restoring the collection from the dumped backup.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-oplogReplay
|
||||
Replays the \fIoplog\fP after restoring the dump to ensure that the current
|
||||
state of the database reflects the point\-in\-time backup captured with
|
||||
the "\fImongodump \-\-oplog\fP" command. For an example of
|
||||
\fI\%--oplogReplay\fP, see \fIbackup\-restore\-oplogreplay\fP\&.
|
||||
Replays the \fIoplog\fP after restoring the dump to ensure that the
|
||||
current state of the database reflects the point\-in\-time backup captured
|
||||
with the "\fImongodump \-\-oplog\fP" command. For an example of
|
||||
\fI\%\-\-oplogReplay\fP, see \fIbackup\-restore\-oplogreplay\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-oplogLimit <timestamp>
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Prevents \fBmongorestore\fP from applying \fIoplog\fP entries
|
||||
newer than the \fB<timestamp>\fP\&. Specify \fB<timestamp>\fP values in the
|
||||
form of \fB<time_t>:<ordinal>\fP, where \fB<time_t>\fP is the seconds since
|
||||
the UNIX epoch, and \fB<ordinal>\fP represents a counter of operations in
|
||||
the oplog that occurred in the specified second.
|
||||
.sp
|
||||
You must use \fI\%\-\-oplogLimit\fP in conjunction with the
|
||||
\fI\%\-\-oplogReplay\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -332,14 +424,12 @@ version during the restoration process.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-w <number of replicas per write>
|
||||
.B \-\-noIndexRestore
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Specifies the \fIwrite concern\fP for each write operation that
|
||||
\fBmongorestore\fP writes to the target database. By default,
|
||||
\fBmongorestore\fP does not wait for a response for
|
||||
\fIwrite acknowledgment\fP\&.
|
||||
Prevents \fBmongorestore\fP from restoring and building indexes as
|
||||
specified in the corresponding \fBmongodump\fP output.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -347,34 +437,20 @@ Specifies the \fIwrite concern\fP for each write operation that
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Prevents \fBmongorestore\fP from setting the collection
|
||||
options, such as those specified by the \fBcollMod\fP
|
||||
\fIdatabase command\fP, on restored collections.
|
||||
Prevents \fBmongorestore\fP from setting the collection options,
|
||||
such as those specified by the \fBcollMod\fP \fIdatabase
|
||||
command\fP, on restored collections.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-noIndexRestore
|
||||
.B \-\-w <number of replicas per write>
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Prevents \fBmongorestore\fP from restoring and building
|
||||
indexes as specified in the corresponding \fBmongodump\fP
|
||||
output.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-oplogLimit <timestamp>
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Prevents \fBmongorestore\fP from applying \fIoplog\fP entries newer
|
||||
than the \fB<timestamp>\fP\&. Specify \fB<timestamp>\fP values in the
|
||||
form of \fB<time_t>:<ordinal>\fP, where \fB<time_t>\fP is the seconds
|
||||
since the UNIX epoch, and \fB<ordinal>\fP represents a counter of
|
||||
operations in the oplog that occurred in the specified second.
|
||||
.sp
|
||||
You must use \fI\%--oplogLimit\fP in conjunction with the
|
||||
\fI\%--oplogReplay\fP option.
|
||||
Specifies the \fIwrite concern\fP for each write operation that
|
||||
\fBmongorestore\fP writes to the target database. By default,
|
||||
\fBmongorestore\fP does not wait for a response for \fIwrite
|
||||
acknowledgment\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -383,9 +459,9 @@ The final argument of the \fBmongorestore\fP command is a
|
||||
directory path. This argument specifies the location of the
|
||||
database dump from which to restore.
|
||||
.UNINDENT
|
||||
.SH USAGE
|
||||
.SH USE
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/backup\-databases\-with\-binary\-database\-dumps
|
||||
See http://docs.mongodb.org/manual/tutorial/backup\-with\-mongodump
|
||||
for a larger overview of \fBmongorestore\fP
|
||||
usage. Also see the \fBmongodump\fP document for an overview of the
|
||||
\fBmongodump\fP, which provides the related inverse
|
||||
@ -444,6 +520,6 @@ mongorestore \-\-host mongodb1.example.net \-\-port 37017 \-\-username user \-\-
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
912
debian/mongos.1
vendored
912
debian/mongos.1
vendored
File diff suppressed because it is too large
Load Diff
46
debian/mongosniff.1
vendored
46
debian/mongosniff.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOSNIFF" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOSNIFF" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongosniff \- MongoDB
|
||||
mongosniff \- MongoDB Protocol Introspection Utility
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -77,21 +77,20 @@ wire protocol.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongosniff\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-forward <host><:port>
|
||||
Declares a host to forward all parsed requests that the
|
||||
\fBmongosniff\fP intercepts to another \fBmongod\fP
|
||||
instance and issue those operations on that database instance.
|
||||
\fBmongosniff\fP intercepts to another \fBmongod\fP instance
|
||||
and issue those operations on that database instance.
|
||||
.sp
|
||||
Specify the target host name and port in the \fB<host><:port>\fP
|
||||
format.
|
||||
Specify the target host name and port in the \fB<host><:port>\fP format.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -105,33 +104,32 @@ name, and a seed list of set members, in the following format:
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-source <NET [interface]>, <FILE [filename]>, <DIAGLOG [filename]>
|
||||
Specifies source material to inspect. Use \fB\-\-source NET
|
||||
[interface]\fP to inspect traffic from a network interface
|
||||
(e.g. \fBeth0\fP or \fBlo\fP\&.) Use \fB\-\-source FILE [filename]\fP to
|
||||
read captured packets in \fIpcap\fP format.
|
||||
.B \-\-source <NET [interface]>
|
||||
Specifies source material to inspect. Use \fB\-\-source NET [interface]\fP
|
||||
to inspect traffic from a network interface (e.g. \fBeth0\fP or \fBlo\fP\&.)
|
||||
Use \fB\-\-source FILE [filename]\fP to read captured packets in
|
||||
\fIpcap\fP format.
|
||||
.sp
|
||||
You may use the \fB\-\-source DIAGLOG [filename]\fP option to read
|
||||
the output files produced by the \fI\-\-diaglog\fP
|
||||
You may use the \fB\-\-source DIAGLOG [filename]\fP option to read the
|
||||
output files produced by the \fI\-\-diaglog\fP
|
||||
option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-objcheck
|
||||
Modifies the behavior to \fIonly\fP display invalid BSON objects and
|
||||
nothing else. Use this option for troubleshooting driver
|
||||
development. This option has some performance impact on the
|
||||
performance of \fBmongosniff\fP\&.
|
||||
Displays invalid BSON objects only and nothing else. Use this option for
|
||||
troubleshooting driver development. This option has some performance
|
||||
impact on the performance of \fBmongosniff\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B <port>
|
||||
Specifies alternate ports to sniff for traffic. By default,
|
||||
\fBmongosniff\fP watches for MongoDB traffic on port 27017. Append
|
||||
\fBmongosniff\fP watches for MongoDB traffic on port \fB27017\fP\&. Append
|
||||
multiple port numbers to the end of \fBmongosniff\fP to monitor
|
||||
traffic on multiple ports.
|
||||
.UNINDENT
|
||||
.SH USAGE
|
||||
.SH USE
|
||||
.sp
|
||||
Use the following command to connect to a \fBmongod\fP or
|
||||
\fBmongos\fP running on port 27017 \fIand\fP 27018 on the localhost
|
||||
@ -214,6 +212,6 @@ must run \fBscons clean\fP before you can build \fBmongosniff\fP\&.
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
251
debian/mongostat.1
vendored
251
debian/mongostat.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOSTAT" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOSTAT" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongostat \- MongoDB
|
||||
mongostat \- MongoDB Use Statistics
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -77,33 +77,30 @@ instance.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongostat\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including
|
||||
the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Returns the version of the \fBmongostat\fP utility.
|
||||
Returns the \fBmongostat\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP from which you
|
||||
want to export data. By default \fBmongostat\fP attempts to connect
|
||||
to a MongoDB instance running on the localhost port number \fB27017\fP\&.
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongostat\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -114,76 +111,138 @@ name, and a seed list of set members, in the following format:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can always connect directly to a single MongoDB instance by
|
||||
specifying the host and port number directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running on
|
||||
the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fImongostat \-\-host\fP command.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongostat\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongostat\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongostat\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongostat\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ssl
|
||||
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
|
||||
instances in mongostat\&.
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBNOTE:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
SSL support in mongostat is not compiled into the default
|
||||
distribution of MongoDB. See
|
||||
http://docs.mongodb.org/manual/tutorial/configure\-ssl for more information on SSL
|
||||
and MongoDB.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
Additionally, mongostat does not support connections to
|
||||
\fBmongod\fP instances that require client certificate
|
||||
validation.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
Allows \fBmongostat\fP to connect to \fBmongod\fP
|
||||
instance over an SSL connection.
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if your
|
||||
database requires authentication. Use in conjunction with the
|
||||
\fImongostat \-\-password\fP option to supply a password.
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
\fBIMPORTANT:\fP
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
This user must have sufficient credentials to run
|
||||
the \fBserverStatus\fP command, which is the
|
||||
\fBclusterAdmin\fP role. See
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges and
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents for more information.
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fImongostat \-\-username\fP option to
|
||||
supply a username.
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP, and do do not pass an
|
||||
argument to \fI\-\-password\fP, \fBmongostat\fP will prompt
|
||||
for a password interactively. If you do not specify a password on
|
||||
the command line, \fI\-\-password\fP must be the last argument
|
||||
specified.
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\-\-sslPEMKeyFile\fP). Use \fI\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongostat\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\-\-sslPEMKeyPassword\fP, \fBmongostat\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongostat\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -191,17 +250,10 @@ specified.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongostat\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongostat\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -209,13 +261,11 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongostat\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongostat\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
@ -225,14 +275,13 @@ Disables the output of column or field names.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-rowcount <number>, \-n <number>
|
||||
.B \-\-rowcount <number>, \-n
|
||||
Controls the number of rows to output. Use in conjunction with
|
||||
the \fBsleeptime\fP argument to control the duration of a
|
||||
\fBmongostat\fP operation.
|
||||
.sp
|
||||
Unless \fI\%--rowcount\fP is specified, \fBmongostat\fP
|
||||
will return an infinite number
|
||||
of rows (e.g. value of \fB0\fP\&.)
|
||||
Unless \fI\%\-\-rowcount\fP is specified, \fBmongostat\fP
|
||||
will return an infinite number of rows (e.g. value of \fB0\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -243,16 +292,20 @@ rather than a raw database connection.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-discover
|
||||
With this option \fBmongostat\fP discovers and reports on
|
||||
statistics from all members of a \fIreplica set\fP or
|
||||
\fIsharded cluster\fP\&. When connected to any member of a replica
|
||||
set, \fI\%--discover\fP all non\-\fIhidden members\fP of the replica set. When connected to a \fBmongos\fP,
|
||||
\fBmongostat\fP will return data from all \fIshards\fP in the cluster. If a replica set provides a shard in the
|
||||
sharded cluster, \fBmongostat\fP will report on non\-hidden
|
||||
members of that replica set.
|
||||
Discovers and reports on statistics from all members of a \fIreplica
|
||||
set\fP or \fIsharded cluster\fP\&. When connected to any member of a
|
||||
replica set, \fI\%\-\-discover\fP all non\-\fIhidden members\fP of the replica set. When connected to a \fBmongos\fP,
|
||||
\fBmongostat\fP will return data from all \fIshards\fP in
|
||||
the cluster. If a replica set provides a shard in the sharded cluster,
|
||||
\fBmongostat\fP will report on non\-hidden members of that replica
|
||||
set.
|
||||
.sp
|
||||
The \fImongostat \-\-host\fP option is not required but
|
||||
potentially useful in this case.
|
||||
.sp
|
||||
Changed in version 2.6: When running with \fI\%\-\-discover\fP, \fBmongostat\fP now
|
||||
respects :option:\-\-rowcount\(ga.
|
||||
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -328,13 +381,19 @@ data size at the time of the last \fBmongostat\fP call.
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B size
|
||||
The amount of (virtual) memory in megabytes used by the process at
|
||||
The amount of virtual memory in megabytes used by the process at
|
||||
the time of the last \fBmongostat\fP call.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B non\-mapped
|
||||
The total amount of virtual memory excluding all mapped memory at
|
||||
the time of the last \fBmongostat\fP call.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B res
|
||||
The amount of (resident) memory in megabytes used by the process at
|
||||
The amount of resident memory in megabytes used by the process at
|
||||
the time of the last \fBmongostat\fP call.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
@ -547,6 +606,6 @@ mongostat \-\-discover
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
240
debian/mongotop.1
vendored
240
debian/mongotop.1
vendored
@ -1,8 +1,8 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "MONGOTOP" "1" "October 03, 2013" "2.4" "mongodb-manual"
|
||||
.TH "MONGOTOP" "1" "March 18, 2014" "2.6" "mongodb-manual"
|
||||
.SH NAME
|
||||
mongotop \- MongoDB
|
||||
mongotop \- MongoDB Activity Monitor
|
||||
.
|
||||
.nr rst2man-indent-level 0
|
||||
.
|
||||
@ -71,34 +71,46 @@ see \fBmongostat\fP\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-help
|
||||
Returns a basic help and usage text.
|
||||
.B \-\-help, \-h
|
||||
Returns information on \fBmongotop\fP options and usage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-verbose, \-v
|
||||
Increases the amount of internal reporting returned on the command
|
||||
line. Increase the verbosity with the \fB\-v\fP form by including the
|
||||
option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
Increases the amount of internal reporting returned on standard output
|
||||
or in log files. Increase the verbosity with the \fB\-v\fP form by
|
||||
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-quiet
|
||||
Runs \fBmongotop\fP in a quiet mode that attempts to limit the amount of
|
||||
output. This option suppresses:
|
||||
.INDENT 7.0
|
||||
.IP \(bu 2
|
||||
output from \fIdatabase commands\fP
|
||||
.IP \(bu 2
|
||||
replication activity
|
||||
.IP \(bu 2
|
||||
connection accepted events
|
||||
.IP \(bu 2
|
||||
connection closed events
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-version
|
||||
Print the version of the \fBmongotop\fP utility and exit.
|
||||
Returns the \fBmongotop\fP release number.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-host <hostname><:port>
|
||||
Specifies a resolvable hostname for the \fBmongod\fP from which you
|
||||
want to export data. By default \fBmongotop\fP attempts to
|
||||
connect to a MongoDB process running on the localhost port number
|
||||
\fB27017\fP\&.
|
||||
.B \-\-host <hostname><:port>, \-h
|
||||
Specifies a resolvable hostname for the \fBmongod\fP to which to
|
||||
connect. By default \fBmongotop\fP attempts to connect to a MongoDB instance
|
||||
running on the localhost on port number \fB27017\fP\&.
|
||||
.sp
|
||||
Optionally, specify a port number to connect a MongoDB instance
|
||||
running on a port other than \fB27017\fP\&.
|
||||
.sp
|
||||
To connect to a replica set, you can specify the replica set seed
|
||||
name, and a seed list of set members, in the following format:
|
||||
To connect to a replica set, specify the replica set seed name and the
|
||||
seed list of set members. Use the following format:
|
||||
.INDENT 7.0
|
||||
.INDENT 3.5
|
||||
.sp
|
||||
@ -109,42 +121,138 @@ name, and a seed list of set members, in the following format:
|
||||
.fi
|
||||
.UNINDENT
|
||||
.UNINDENT
|
||||
.sp
|
||||
You can always connect directly to a single MongoDB instance by
|
||||
specifying the host and port number directly.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-port <port>
|
||||
Specifies the port number, if the MongoDB instance is not running on
|
||||
the standard port. (i.e. \fB27017\fP) You may also specify a port
|
||||
number using the \fImongotop \-\-host\fP command.
|
||||
Specifies the port number when the MongoDB instance is not running on the
|
||||
standard port of \fB27017\fP\&. You may also specify the port number
|
||||
using the \fB\-\-host\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-ipv6
|
||||
Enables IPv6 support that allows \fBmongotop\fP to connect
|
||||
to the MongoDB instance using an IPv6 network. All MongoDB programs
|
||||
and processes, including \fBmongotop\fP, disable IPv6
|
||||
support by default.
|
||||
Enables IPv6 support, which allows \fBmongotop\fP to connect to the MongoDB
|
||||
instance using an IPv6 network. All MongoDB programs and processes,
|
||||
including \fBmongotop\fP, disable IPv6 support by default.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u <username>
|
||||
Specifies a username to authenticate to the MongoDB instance, if
|
||||
your database requires authentication. Use in conjunction with the
|
||||
\fImongotop\fP option to supply a
|
||||
password.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p <password>
|
||||
Specifies a password to authenticate to the MongoDB instance. Use
|
||||
in conjunction with the \fI\-\-username\fP
|
||||
option to supply a username.
|
||||
.B \-\-ssl
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
If you specify a \fI\-\-username\fP and do
|
||||
not pass an argument to \fI\-\-password\fP, \fBmongotop\fP
|
||||
will prompt for a password interactively. If you do not specify a
|
||||
password on the command line, \fI\-\-password\fP must be the last
|
||||
argument specified.
|
||||
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
|
||||
SSL support enabled.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCAFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the root certificate chain
|
||||
from the Certificate Authority. Specify the file name of the
|
||||
\fB\&.pem\fP file using relative or absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
|
||||
and key. Specify the file name of the \fB\&.pem\fP file using relative
|
||||
or absolute paths.
|
||||
.sp
|
||||
This option is required when using the \fI\%\-\-ssl\fP option to connect
|
||||
to a \fBmongod\fP or \fBmongos\fP that has
|
||||
\fBsslCAFile\fP enabled \fIwithout\fP
|
||||
\fBsslWeakCertificateValidation\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslPEMKeyPassword <value>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the password to de\-crypt the certificate\-key file (i.e.
|
||||
\fI\%\-\-sslPEMKeyFile\fP). Use \fI\%\-\-sslPEMKeyPassword\fP only if
|
||||
the certificate\-key file is encrypted. In all cases, \fBmongotop\fP will
|
||||
redact the password from all logging and reporting output.
|
||||
.sp
|
||||
If the private key in the PEM file is encrypted and you do not specify
|
||||
\fI\%\-\-sslPEMKeyPassword\fP, \fBmongotop\fP will prompt for a passphrase.
|
||||
See \fIssl\-certificate\-password\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslCRLFile <filename>
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
|
||||
List. Specify the file name of the \fB\&.pem\fP file using relative or
|
||||
absolute paths.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslAllowInvalidCertificates
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Bypasses the validation checks for server certificates and allows
|
||||
the use of invalid certificates. When using the
|
||||
\fBsslAllowInvalidCertificates\fP setting, MongoDB logs as a
|
||||
warning the use of the invalid certificate.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-sslFIPSMode
|
||||
New in version 2.6.
|
||||
|
||||
.sp
|
||||
Directs \fBmongotop\fP to use the FIPS mode of the installed OpenSSL
|
||||
library. Your system must
|
||||
have a FIPS compliant OpenSSL library to use \fI\%\-\-sslFIPSMode\fP\&.
|
||||
.sp
|
||||
The default distribution of MongoDB does not contain support for SSL.
|
||||
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-username <username>, \-u
|
||||
Specifies a username with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-password <password>, \-p
|
||||
Specifies a password with which to authenticate to a MongoDB database
|
||||
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
|
||||
\fB\-\-authenticationDatabase\fP options.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -152,17 +260,10 @@ argument specified.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the database that holds the user\(aqs (e.g
|
||||
\fI\-\-username\fP) credentials.
|
||||
.sp
|
||||
By default, \fBmongotop\fP assumes that the database specified to the
|
||||
\fI\-\-db\fP argument holds the user\(aqs credentials, unless you
|
||||
specify \fI\-\-authenticationDatabase\fP\&.
|
||||
.sp
|
||||
See \fBuserSource\fP,
|
||||
http://docs.mongodb.org/manual/reference/privilege\-documents and
|
||||
http://docs.mongodb.org/manual/reference/user\-privileges for more information about
|
||||
delegated authentication in MongoDB.
|
||||
Specifies the database that holds the user\(aqs credentials.
|
||||
If you do not specify an authentication database, \fBmongotop\fP assumes
|
||||
that the database specified as the argument to the \fI\-\-db\fP option
|
||||
holds the user\(aqs credentials.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -170,31 +271,26 @@ delegated authentication in MongoDB.
|
||||
New in version 2.4.
|
||||
|
||||
.sp
|
||||
Specifies the authentication mechanism. By default, the
|
||||
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
|
||||
challenge/response authentication mechanism. In MongoDB Enterprise,
|
||||
\fBmongotop\fP also includes support for \fBGSSAPI\fP to handle
|
||||
Kerberos authentication.
|
||||
.sp
|
||||
See http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
Specifies the authentication mechanism. By default, the authentication
|
||||
mechanism is \fBMONGODB\-CR\fP, which is the MongoDB challenge/response
|
||||
authentication mechanism. In MongoDB Enterprise, \fBmongotop\fP also includes
|
||||
support for \fBGSSAPI\fP to handle Kerberos authentication. See
|
||||
http://docs.mongodb.org/manual/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication
|
||||
for more information about Kerberos authentication.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B \-\-locks
|
||||
New in version 2.2.
|
||||
|
||||
.sp
|
||||
Toggles the mode of \fBmongotop\fP to report on use of
|
||||
per\-database \fIlocks\fP\&. These data are useful for
|
||||
measuring concurrent operations and lock percentage.
|
||||
Toggles the mode of \fBmongotop\fP to report on use of per\-database
|
||||
\fIlocks\fP\&. These data are useful for measuring concurrent
|
||||
operations and lock percentage.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
.B <sleeptime>
|
||||
The final argument is the length of time, in seconds, that
|
||||
\fBmongotop\fP waits in between calls. By default
|
||||
\fBmongotop\fP returns data every second.
|
||||
\fBmongotop\fP waits in between calls. By default \fBmongotop\fP returns
|
||||
data every second.
|
||||
.UNINDENT
|
||||
.SH FIELDS
|
||||
.sp
|
||||
@ -202,7 +298,7 @@ The final argument is the length of time, in seconds, that
|
||||
(ms.)
|
||||
.sp
|
||||
\fBmongotop\fP only reports active namespaces or databases,
|
||||
depending on the \fI\%--locks\fP option. If you don\(aqt see a database
|
||||
depending on the \fI\%\-\-locks\fP option. If you don\(aqt see a database
|
||||
or collection, it has received no recent activity. You can issue a
|
||||
simple operation in the \fBmongo\fP shell to generate activity to
|
||||
affect the output of \fBmongotop\fP\&.
|
||||
@ -212,7 +308,7 @@ affect the output of \fBmongotop\fP\&.
|
||||
Contains the database namespace, which combines the database name
|
||||
and collection.
|
||||
.sp
|
||||
Changed in version 2.2: If you use the \fI\%--locks\fP, the \fBns\fP field does not
|
||||
Changed in version 2.2: If you use the \fI\%\-\-locks\fP, the \fBns\fP field does not
|
||||
appear in the \fBmongotop\fP output.
|
||||
|
||||
.UNINDENT
|
||||
@ -226,7 +322,7 @@ Contains the name of the database. The database named \fB\&.\fP refers
|
||||
to the global lock, rather than a specific database.
|
||||
.sp
|
||||
This field does not appear unless you have invoked
|
||||
\fBmongotop\fP with the \fI\%--locks\fP option.
|
||||
\fBmongotop\fP with the \fI\%\-\-locks\fP option.
|
||||
.UNINDENT
|
||||
.INDENT 0.0
|
||||
.TP
|
||||
@ -333,6 +429,6 @@ connected to: 127.0.0.1
|
||||
.SH AUTHOR
|
||||
MongoDB Documentation Project
|
||||
.SH COPYRIGHT
|
||||
2011-2013, MongoDB, Inc.
|
||||
2011-2014, MongoDB, Inc.
|
||||
.\" Generated by docutils manpage writer.
|
||||
.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = MongoDB
|
||||
PROJECT_NUMBER = 2.6.0-rc2-pre-
|
||||
PROJECT_NUMBER = 2.6.3
|
||||
OUTPUT_DIRECTORY = docs/doxygen
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
// For testing the test runner.
|
||||
assert.eq(1, 2, "fail1")
|
||||
|
||||
print("you should not see this")
|
||||
@ -1,4 +0,0 @@
|
||||
// Start mongod and run jstests/_runner.js
|
||||
|
||||
db = startMongod( "--port", "27018", "--dbpath", MongoRunner.dataDir + "/jstests" ).getDB( "test" );
|
||||
load( "jstests/_runner.js" );
|
||||
@ -1,28 +0,0 @@
|
||||
//
|
||||
// simple runner to run toplevel tests in jstests
|
||||
//
|
||||
var files = listFiles("jstests");
|
||||
|
||||
var runnerStart = new Date()
|
||||
|
||||
files.forEach(
|
||||
function(x) {
|
||||
|
||||
if ( /[\/\\]_/.test(x.name) ||
|
||||
! /\.js$/.test(x.name ) ){
|
||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
print(" *******************************************");
|
||||
print(" Test : " + x.name + " ...");
|
||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
var runnerEnd = new Date()
|
||||
|
||||
print( "total runner time: " + ( ( runnerEnd.getTime() - runnerStart.getTime() ) / 1000 ) + "secs" )
|
||||
@ -1,44 +0,0 @@
|
||||
//
|
||||
// simple runner to run toplevel tests in jstests
|
||||
//
|
||||
var files = listFiles("jstests");
|
||||
|
||||
var dummyDb = db.getSisterDB( "dummyDBdummydummy" );
|
||||
|
||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
prev = dummyDb.serverStatus();
|
||||
|
||||
print( "START : " + tojson( prev ) );
|
||||
|
||||
files.forEach(
|
||||
function(x) {
|
||||
|
||||
if ( /_runner/.test(x.name) ||
|
||||
/_lodeRunner/.test(x.name) ||
|
||||
! /\.js$/.test(x.name ) ){
|
||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
print(" *******************************************");
|
||||
print(" Test : " + x.name + " ...");
|
||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
||||
|
||||
assert( dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
||||
var now = dummyDb.serverStatus();
|
||||
var leaked = now.mem.virtual - prev.mem.virtual;
|
||||
if ( leaked > 0 ){
|
||||
print( " LEAK : " + prev.mem.virtual + " -->> " + now.mem.virtual );
|
||||
printjson( now );
|
||||
if ( leaked > 20 )
|
||||
throw -1;
|
||||
}
|
||||
prev = now;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
print( "END : " + tojson( dummyDb.serverStatus() ) );
|
||||
@ -1,42 +0,0 @@
|
||||
//
|
||||
// simple runner to run toplevel tests in jstests
|
||||
//
|
||||
var files = listFiles("jstests");
|
||||
|
||||
var dummyDb = db.getSisterDB( "dummyDBdummydummy" );
|
||||
|
||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
prev = dummyDb.runCommand( "meminfo" );
|
||||
|
||||
print( "START : " + tojson( prev ) );
|
||||
|
||||
files.forEach(
|
||||
function(x) {
|
||||
|
||||
if ( /_runner/.test(x.name) ||
|
||||
/_lodeRunner/.test(x.name) ||
|
||||
/jni/.test(x.name) ||
|
||||
/eval/.test(x.name) ||
|
||||
/where/.test(x.name) ||
|
||||
! /\.js$/.test(x.name ) ){
|
||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
print(" *******************************************");
|
||||
print(" Test : " + x.name + " ...");
|
||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
||||
|
||||
assert( dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
||||
var now = dummyDb.runCommand( "meminfo" );
|
||||
if ( now.virtual > prev.virtual )
|
||||
print( " LEAK : " + prev.virtual + " -->> " + now.virtual );
|
||||
prev = now;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
print( "END : " + tojson( dummyDb.runCommand( "meminfo" ) ) );
|
||||
@ -1,35 +0,0 @@
|
||||
//
|
||||
// simple runner to run toplevel tests in jstests
|
||||
//
|
||||
var files = listFiles("jstests/sharding");
|
||||
|
||||
var num = 0;
|
||||
|
||||
files.forEach(
|
||||
function(x) {
|
||||
|
||||
if ( /_runner/.test(x.name) ||
|
||||
/_lodeRunner/.test(x.name) ||
|
||||
! /\.js$/.test(x.name ) ){
|
||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( num++ > 0 ){
|
||||
sleep( 1000 ); // let things fully come down
|
||||
}
|
||||
|
||||
print(" *******************************************");
|
||||
print(" Test : " + x.name + " ...");
|
||||
try {
|
||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
||||
}
|
||||
catch ( e ){
|
||||
print( " ERROR on " + x.name + "!! " + e );
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
/* a general testing framework (helpers) for us in the jstests/
|
||||
|
||||
to use, from your test file:
|
||||
testname="mytestname";
|
||||
load("jstests/_tst.js");
|
||||
*/
|
||||
|
||||
if( typeof tst == "undefined" ) {
|
||||
tst = {}
|
||||
|
||||
tst.log = function (optional_msg) {
|
||||
print("\n\nstep " + ++this._step + " " + (optional_msg || ""));
|
||||
}
|
||||
|
||||
tst.success = function () {
|
||||
print(testname + " SUCCESS");
|
||||
}
|
||||
|
||||
/* diff files a and b, returning the difference (empty str if no difference) */
|
||||
tst.diff = function(a, b) {
|
||||
function reSlash(s) {
|
||||
var x = s;
|
||||
if (_isWindows()) {
|
||||
while (1) {
|
||||
var y = x.replace('/', '\\');
|
||||
if (y == x)
|
||||
break;
|
||||
x = y;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
a = reSlash(a);
|
||||
b = reSlash(b);
|
||||
print("diff " + a + " " + b);
|
||||
return run("diff", a, b);
|
||||
}
|
||||
}
|
||||
|
||||
print(testname + " BEGIN");
|
||||
tst._step = 0;
|
||||
25
jstests/aggregation/bugs/server13715.js
Normal file
25
jstests/aggregation/bugs/server13715.js
Normal file
@ -0,0 +1,25 @@
|
||||
// Make sure that aggregation and query agree on how NO_BLOCKING_SORT should fail
|
||||
// if only blocking sort solutions are available.
|
||||
|
||||
var t = db.jstests_server13715;
|
||||
t.drop();
|
||||
|
||||
t.save({_id: 0, name: "red", value: 2});
|
||||
t.save({_id: 1, name: "blue", value: 1});
|
||||
|
||||
var cursor = t.aggregate([
|
||||
{$match: {$or: [{name: "red"}, {name: "blue"}]}},
|
||||
{$sort: {value: 1}}
|
||||
]);
|
||||
assert.eq(1, cursor.next()["_id"]);
|
||||
assert.eq(0, cursor.next()["_id"]);
|
||||
|
||||
// Repeat the test with an index.
|
||||
t.ensureIndex({name: 1});
|
||||
|
||||
cursor = t.aggregate([
|
||||
{$match: {$or: [{name: "red"}, {name: "blue"}]}},
|
||||
{$sort: {value: 1}}
|
||||
]);
|
||||
assert.eq(1, cursor.next()["_id"]);
|
||||
assert.eq(0, cursor.next()["_id"]);
|
||||
@ -6,8 +6,6 @@ t.drop();
|
||||
|
||||
t.insert( { _id : 0 , x : 0 , undef: undefined } );
|
||||
|
||||
db.getLastError();
|
||||
|
||||
// Make sure having an undefined doesn't break pipelines not using the field
|
||||
res = t.aggregate( { $project : { x : 1 } } ).toArray();
|
||||
assert.eq(res[0].x, 0);
|
||||
|
||||
@ -15,7 +15,6 @@ N = 100;
|
||||
for( i = 0; i < N; ++i ) {
|
||||
d.data.insert( { _id:i } )
|
||||
}
|
||||
d.getLastError();
|
||||
|
||||
// Split the data into 3 chunks.
|
||||
s.adminCommand( { split:"test.data", middle:{ _id:33 } } );
|
||||
|
||||
@ -12,7 +12,6 @@ d = s.getDB( "test" );
|
||||
for( i = 0; i < 100; ++i ) {
|
||||
d.data.insert( { _id:i, i:i%10 } )
|
||||
}
|
||||
d.getLastError();
|
||||
|
||||
// Split the data into 3 chunks.
|
||||
s.adminCommand( { split:"test.data", middle:{ _id:33 } } );
|
||||
|
||||
@ -66,10 +66,12 @@ function test(db, sharded, indexType) {
|
||||
|
||||
// insert points
|
||||
var numPts = 10*1000;
|
||||
var bulk = db[coll].initializeUnorderedBulkOp();
|
||||
for (var i=0; i < numPts; i++) {
|
||||
db[coll].insert({rand:Math.random(), loc: pointMaker.mkPt()});
|
||||
bulk.insert({ rand: Math.random(), loc: pointMaker.mkPt() });
|
||||
}
|
||||
db.getLastError();
|
||||
assert.writeOK(bulk.execute());
|
||||
|
||||
assert.eq(db[coll].count(), numPts);
|
||||
|
||||
db[coll].ensureIndex({loc: indexType});
|
||||
|
||||
@ -13,8 +13,7 @@ if (doSharded) {
|
||||
testDB.adminCommand({ shardCollection: 'test.user', key: { x: 1 }});
|
||||
}
|
||||
|
||||
testDB.user.insert({ x: 10 });
|
||||
testDB.runCommand({ getLastError: 1, w: NODES });
|
||||
testDB.user.insert({ x: 10 }, { writeConcern: { w: NODES }});
|
||||
testDB.setSlaveOk(true);
|
||||
|
||||
var secNode = st.rs0.getSecondary();
|
||||
|
||||
@ -7,10 +7,10 @@ replTest.awaitReplication();
|
||||
var mast = nodes[0].getDB('test');
|
||||
var slav = nodes[1].getDB('test');
|
||||
|
||||
mast.agg.insert({});
|
||||
mast.agg.insert({});
|
||||
mast.agg.insert({});
|
||||
mast.getLastError(2);
|
||||
var options = { writeConcern: { w: 2 }};
|
||||
mast.agg.insert({}, options);
|
||||
mast.agg.insert({}, options);
|
||||
mast.agg.insert({}, options);
|
||||
|
||||
var res = slav.agg.aggregate({$group: {_id: null, count: {$sum: 1}}});
|
||||
assert.eq(res.toArray(), [{_id:null, count: 3}]);
|
||||
|
||||
@ -74,14 +74,13 @@ var strings = [
|
||||
];
|
||||
|
||||
var nItems = 200000;
|
||||
var bulk = db.ts1.initializeUnorderedBulkOp();
|
||||
for(i = 1; i <= nItems; ++i) {
|
||||
db.ts1.save(
|
||||
bulk.insert(
|
||||
{counter: ++count, number: strings[i % 20], random: Math.random(),
|
||||
filler: "0123456789012345678901234567890123456789"});
|
||||
}
|
||||
|
||||
// wait for all writebacks to be applied
|
||||
assert.eq(db.getLastError(), null);
|
||||
assert.writeOK(bulk.execute());
|
||||
|
||||
// Turn on exception tracing in mongod to figure out exactly where the SCEs are coming from
|
||||
// TEMPORARY - REMOVE ONCE SERVER-9622 IS RESOLVED
|
||||
@ -154,7 +153,7 @@ for(i = 0; i < 6; ++i) {
|
||||
c = a4[i].counter;
|
||||
printjson({c:c})
|
||||
assert((c == 55) || (c == 1111) || (c == 2222) ||
|
||||
(c == 33333) || (c = 99999) || (c == 55555),
|
||||
(c == 33333) || (c == 99999) || (c == 55555),
|
||||
'agg sharded test simple match failed');
|
||||
}
|
||||
|
||||
@ -181,10 +180,12 @@ testSkipLimit([{$limit:10}, {$skip:5}, {$skip: 3}], 10 - 3 - 5);
|
||||
|
||||
// test sort + limit (using random to pull from both shards)
|
||||
function testSortLimit(limit, direction) {
|
||||
shardedAggTest.stopBalancer(); // TODO: remove after fixing SERVER-9622
|
||||
var from_cursor = db.ts1.find({},{random:1, _id:0})
|
||||
.sort({random: direction})
|
||||
.limit(limit)
|
||||
.toArray();
|
||||
shardedAggTest.startBalancer(); // TODO: remove after fixing SERVER-9622
|
||||
var from_agg = aggregateOrdered(db.ts1, [{$project: {random:1, _id:0}}
|
||||
,{$sort: {random: direction}}
|
||||
,{$limit: limit}
|
||||
@ -201,9 +202,11 @@ testSortLimit(100, -1);
|
||||
// test $out by copying source collection verbatim to output
|
||||
var outCollection = db.ts1_out;
|
||||
var res = aggregateOrdered(db.ts1, [{$out: outCollection.getName()}]);
|
||||
shardedAggTest.stopBalancer(); // TODO: remove after fixing SERVER-9622
|
||||
assert.eq(db.ts1.find().itcount(), outCollection.find().itcount());
|
||||
assert.eq(db.ts1.find().sort({_id:1}).toArray(),
|
||||
outCollection.find().sort({_id:1}).toArray());
|
||||
shardedAggTest.startBalancer(); // TODO: remove after fixing SERVER-9622
|
||||
|
||||
// Make sure we error out if $out collection is sharded
|
||||
assertErrorCode(outCollection, [{$out: db.ts1.getName()}], 17017);
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
t = db.jstests_all;
|
||||
t.drop();
|
||||
|
||||
doTest = function() {
|
||||
|
||||
t.save( { a:[ 1,2,3 ] } );
|
||||
t.save( { a:[ 1,2,4 ] } );
|
||||
t.save( { a:[ 1,8,5 ] } );
|
||||
t.save( { a:[ 1,8,6 ] } );
|
||||
t.save( { a:[ 1,9,7 ] } );
|
||||
t.save( { a : [] } );
|
||||
t.save( {} );
|
||||
|
||||
assert.eq( 5, t.find( { a: { $all: [ 1 ] } } ).count() );
|
||||
assert.eq( 2, t.find( { a: { $all: [ 1, 2 ] } } ).count() );
|
||||
assert.eq( 2, t.find( { a: { $all: [ 1, 8 ] } } ).count() );
|
||||
assert.eq( 1, t.find( { a: { $all: [ 1, 3 ] } } ).count() );
|
||||
assert.eq( 2, t.find( { a: { $all: [ 2 ] } } ).count() );
|
||||
assert.eq( 1, t.find( { a: { $all: [ 2, 3 ] } } ).count() );
|
||||
assert.eq( 2, t.find( { a: { $all: [ 2, 1 ] } } ).count() );
|
||||
|
||||
t.save( { a: [ 2, 2 ] } );
|
||||
assert.eq( 3, t.find( { a: { $all: [ 2, 2 ] } } ).count() );
|
||||
|
||||
t.save( { a: [ [ 2 ] ] } );
|
||||
assert.eq( 3, t.find( { a: { $all: [ 2 ] } } ).count() );
|
||||
|
||||
t.save( { a: [ { b: [ 10, 11 ] }, 11 ] } );
|
||||
assert.eq( 1, t.find( { 'a.b': { $all: [ 10 ] } } ).count() );
|
||||
assert.eq( 1, t.find( { a: { $all: [ 11 ] } } ).count() );
|
||||
|
||||
t.save( { a: { b: [ 20, 30 ] } } );
|
||||
assert.eq( 1, t.find( { 'a.b': { $all: [ 20 ] } } ).count() );
|
||||
assert.eq( 1, t.find( { 'a.b': { $all: [ 20, 30 ] } } ).count() );
|
||||
|
||||
|
||||
assert.eq( 5 , t.find( { a : { $all : [1] } } ).count() , "E1" );
|
||||
assert.eq( 0 , t.find( { a : { $all : [19] } } ).count() , "E2" );
|
||||
assert.eq( 0 , t.find( { a : { $all : [] } } ).count() , "E3" );
|
||||
|
||||
|
||||
}
|
||||
|
||||
doTest();
|
||||
t.drop();
|
||||
t.ensureIndex( {a:1} );
|
||||
doTest();
|
||||
@ -1,86 +0,0 @@
|
||||
|
||||
t = db.all2;
|
||||
t.drop();
|
||||
|
||||
t.save( { a : [ { x : 1 } , { x : 2 } ] } )
|
||||
t.save( { a : [ { x : 2 } , { x : 3 } ] } )
|
||||
t.save( { a : [ { x : 3 } , { x : 4 } ] } )
|
||||
|
||||
state = "no index";
|
||||
|
||||
function check( n , q , e ){
|
||||
assert.eq( n , t.find( q ).count() , tojson( q ) + " " + e + " count " + state );
|
||||
assert.eq( n , t.find( q ).itcount() , tojson( q ) + " " + e + " itcount" + state );
|
||||
}
|
||||
|
||||
check( 1 , { "a.x" : { $in : [ 1 ] } } , "A" );
|
||||
check( 2 , { "a.x" : { $in : [ 2 ] } } , "B" );
|
||||
|
||||
check( 2 , { "a.x" : { $in : [ 1 , 2 ] } } , "C" );
|
||||
check( 3 , { "a.x" : { $in : [ 2 , 3 ] } } , "D" );
|
||||
check( 3 , { "a.x" : { $in : [ 1 , 3 ] } } , "E" );
|
||||
|
||||
check( 1 , { "a.x" : { $all : [ 1 , 2 ] } } , "F" );
|
||||
check( 1 , { "a.x" : { $all : [ 2 , 3 ] } } , "G" );
|
||||
check( 0 , { "a.x" : { $all : [ 1 , 3 ] } } , "H" );
|
||||
|
||||
t.ensureIndex( { "a.x" : 1 } );
|
||||
state = "index";
|
||||
|
||||
check( 1 , { "a.x" : { $in : [ 1 ] } } , "A" );
|
||||
check( 2 , { "a.x" : { $in : [ 2 ] } } , "B" );
|
||||
|
||||
check( 2 , { "a.x" : { $in : [ 1 , 2 ] } } , "C" );
|
||||
check( 3 , { "a.x" : { $in : [ 2 , 3 ] } } , "D" );
|
||||
check( 3 , { "a.x" : { $in : [ 1 , 3 ] } } , "E" );
|
||||
|
||||
check( 1 , { "a.x" : { $all : [ 1 , 2 ] } } , "F" );
|
||||
check( 1 , { "a.x" : { $all : [ 2 , 3 ] } } , "G" );
|
||||
check( 0 , { "a.x" : { $all : [ 1 , 3 ] } } , "H" );
|
||||
|
||||
// --- more
|
||||
|
||||
t.drop();
|
||||
|
||||
t.save( { a : [ 1 , 2 ] } )
|
||||
t.save( { a : [ 2 , 3 ] } )
|
||||
t.save( { a : [ 3 , 4 ] } )
|
||||
|
||||
state = "more no index";
|
||||
|
||||
check( 1 , { "a" : { $in : [ 1 ] } } , "A" );
|
||||
check( 2 , { "a" : { $in : [ 2 ] } } , "B" );
|
||||
|
||||
check( 2 , { "a" : { $in : [ 1 , 2 ] } } , "C" );
|
||||
check( 3 , { "a" : { $in : [ 2 , 3 ] } } , "D" );
|
||||
check( 3 , { "a" : { $in : [ 1 , 3 ] } } , "E" );
|
||||
|
||||
check( 1 , { "a" : { $all : [ 1 , 2 ] } } , "F" );
|
||||
check( 1 , { "a" : { $all : [ 2 , 3 ] } } , "G" );
|
||||
check( 0 , { "a" : { $all : [ 1 , 3 ] } } , "H" );
|
||||
|
||||
t.ensureIndex( { "a" : 1 } );
|
||||
state = "more index";
|
||||
|
||||
check( 1 , { "a" : { $in : [ 1 ] } } , "A" );
|
||||
check( 2 , { "a" : { $in : [ 2 ] } } , "B" );
|
||||
|
||||
check( 2 , { "a" : { $in : [ 1 , 2 ] } } , "C" );
|
||||
check( 3 , { "a" : { $in : [ 2 , 3 ] } } , "D" );
|
||||
check( 3 , { "a" : { $in : [ 1 , 3 ] } } , "E" );
|
||||
|
||||
check( 1 , { "a" : { $all : [ 1 , 2 ] } } , "F" );
|
||||
check( 1 , { "a" : { $all : [ 2 , 3 ] } } , "G" );
|
||||
check( 0 , { "a" : { $all : [ 1 , 3 ] } } , "H" );
|
||||
|
||||
|
||||
// more 2
|
||||
|
||||
state = "more 2"
|
||||
|
||||
t.drop();
|
||||
t.save( { name : [ "harry","jack","tom" ] } )
|
||||
check( 0 , { name : { $all : ["harry","john"] } } , "A" );
|
||||
t.ensureIndex( { name : 1 } );
|
||||
check( 0 , { name : { $all : ["harry","john"] } } , "B" );
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
// Check that $all matching null is consistent with $in - SERVER-3820
|
||||
|
||||
t = db.jstests_all3;
|
||||
t.drop();
|
||||
|
||||
t.save({});
|
||||
|
||||
assert.eq( 1, t.count( {foo:{$in:[null]}} ) );
|
||||
assert.eq( 1, t.count( {foo:{$all:[null]}} ) );
|
||||
assert.eq( 0, t.count( {foo:{$not:{$all:[null]}}} ) );
|
||||
assert.eq( 0, t.count( {foo:{$not:{$in:[null]}}} ) );
|
||||
|
||||
t.remove({});
|
||||
t.save({foo:1});
|
||||
assert.eq( 0, t.count( {foo:{$in:[null]}} ) );
|
||||
assert.eq( 0, t.count( {foo:{$all:[null]}} ) );
|
||||
assert.eq( 1, t.count( {foo:{$not:{$in:[null]}}} ) );
|
||||
assert.eq( 1, t.count( {foo:{$not:{$all:[null]}}} ) );
|
||||
|
||||
t.remove({});
|
||||
t.save( {foo:[0,1]} );
|
||||
assert.eq( 1, t.count( {foo:{$in:[[0,1]]}} ) );
|
||||
assert.eq( 1, t.count( {foo:{$all:[[0,1]]}} ) );
|
||||
|
||||
t.remove({});
|
||||
t.save( {foo:[]} );
|
||||
assert.eq( 1, t.count( {foo:{$in:[[]]}} ) );
|
||||
assert.eq( 1, t.count( {foo:{$all:[[]]}} ) );
|
||||
@ -1,30 +0,0 @@
|
||||
// Test $all/$elemMatch with missing field - SERVER-4492
|
||||
|
||||
t = db.jstests_all4;
|
||||
t.drop();
|
||||
|
||||
function checkQuery( query, val ) {
|
||||
assert.eq( val, t.count(query) );
|
||||
assert( !db.getLastError() );
|
||||
assert.eq( val, t.find(query).itcount() );
|
||||
assert( !db.getLastError() );
|
||||
}
|
||||
|
||||
checkQuery( {a:{$all:[]}}, 0 );
|
||||
checkQuery( {a:{$all:[1]}}, 0 );
|
||||
checkQuery( {a:{$all:[{$elemMatch:{b:1}}]}}, 0 );
|
||||
|
||||
t.save({});
|
||||
checkQuery( {a:{$all:[]}}, 0 );
|
||||
checkQuery( {a:{$all:[1]}}, 0 );
|
||||
checkQuery( {a:{$all:[{$elemMatch:{b:1}}]}}, 0 );
|
||||
|
||||
t.save({a:1});
|
||||
checkQuery( {a:{$all:[]}}, 0 );
|
||||
checkQuery( {a:{$all:[1]}}, 1 );
|
||||
checkQuery( {a:{$all:[{$elemMatch:{b:1}}]}}, 0 );
|
||||
|
||||
t.save({a:[{b:1}]});
|
||||
checkQuery( {a:{$all:[]}}, 0 );
|
||||
checkQuery( {a:{$all:[1]}}, 1 );
|
||||
checkQuery( {a:{$all:[{$elemMatch:{b:1}}]}}, 1 );
|
||||
@ -1,28 +0,0 @@
|
||||
// Test $all/$elemMatch/null matching - SERVER-4517
|
||||
|
||||
t = db.jstests_all5;
|
||||
t.drop();
|
||||
|
||||
function checkMatch( doc ) {
|
||||
t.drop();
|
||||
t.save( doc );
|
||||
assert.eq( 1, t.count( {a:{$elemMatch:{b:null}}} ) );
|
||||
assert.eq( 1, t.count( {a:{$all:[{$elemMatch:{b:null}}]}} ) );
|
||||
}
|
||||
|
||||
function checkNoMatch( doc ) {
|
||||
t.drop();
|
||||
t.save( doc );
|
||||
assert.eq( 0, t.count( {a:{$all:[{$elemMatch:{b:null}}]}} ) );
|
||||
}
|
||||
|
||||
checkNoMatch( {} );
|
||||
checkNoMatch( {a:1} );
|
||||
|
||||
checkNoMatch( {a:[]} );
|
||||
checkNoMatch( {a:[1]} );
|
||||
|
||||
checkMatch( {a:[{}]} );
|
||||
checkMatch( {a:[{c:1}]} );
|
||||
checkMatch( {a:[{b:null}]} );
|
||||
checkNoMatch( {a:[{b:1}]}, 0 );
|
||||
@ -1,85 +0,0 @@
|
||||
// Some tests for $and SERVER-1089
|
||||
|
||||
t = db.jstests_and;
|
||||
t.drop();
|
||||
|
||||
t.save( {a:[1,2]} );
|
||||
t.save( {a:'foo'} );
|
||||
|
||||
function check() {
|
||||
// $and must be an array
|
||||
assert.throws( function() { t.find( {$and:4} ).toArray() } );
|
||||
// $and array must not be empty
|
||||
assert.throws( function() { t.find( {$and:[]} ).toArray() } );
|
||||
// $and elements must be objects
|
||||
assert.throws( function() { t.find( {$and:[4]} ).toArray() } );
|
||||
|
||||
// Check equality matching
|
||||
assert.eq( 1, t.count( {$and:[{a:1}]} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:1},{a:2}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:1},{a:3}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:1},{a:2},{a:3}]} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:'foo'}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:'foo'},{a:'g'}]} ) );
|
||||
|
||||
// Check $and with other fields
|
||||
assert.eq( 1, t.count( {a:2,$and:[{a:1}]} ) );
|
||||
assert.eq( 0, t.count( {a:0,$and:[{a:1}]} ) );
|
||||
assert.eq( 0, t.count( {a:2,$and:[{a:0}]} ) );
|
||||
assert.eq( 1, t.count( {a:1,$and:[{a:1}]} ) );
|
||||
|
||||
// Check recursive $and
|
||||
assert.eq( 1, t.count( {a:2,$and:[{$and:[{a:1}]}]} ) );
|
||||
assert.eq( 0, t.count( {a:0,$and:[{$and:[{a:1}]}]} ) );
|
||||
assert.eq( 0, t.count( {a:2,$and:[{$and:[{a:0}]}]} ) );
|
||||
assert.eq( 1, t.count( {a:1,$and:[{$and:[{a:1}]}]} ) );
|
||||
|
||||
assert.eq( 1, t.count( {$and:[{a:2},{$and:[{a:1}]}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:0},{$and:[{a:1}]}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:2},{$and:[{a:0}]}]} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:1},{$and:[{a:1}]}]} ) );
|
||||
|
||||
// Some of these cases were more important with an alternative $and syntax
|
||||
// that was rejected, but they're still valid checks.
|
||||
|
||||
// Check simple regex
|
||||
assert.eq( 1, t.count( {$and:[{a:/foo/}]} ) );
|
||||
// Check multiple regexes
|
||||
assert.eq( 1, t.count( {$and:[{a:/foo/},{a:/^f/},{a:/o/}]} ) );
|
||||
assert.eq( 0, t.count( {$and:[{a:/foo/},{a:/^g/}]} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:/^f/},{a:'foo'}]} ) );
|
||||
// Check regex flags
|
||||
assert.eq( 0, t.count( {$and:[{a:/^F/},{a:'foo'}]} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:/^F/i},{a:'foo'}]} ) );
|
||||
|
||||
|
||||
|
||||
// Check operator
|
||||
assert.eq( 1, t.count( {$and:[{a:{$gt:0}}]} ) );
|
||||
|
||||
// Check where
|
||||
assert.eq( 1, t.count( {a:'foo',$where:'this.a=="foo"'} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:'foo'}],$where:'this.a=="foo"'} ) );
|
||||
assert.eq( 1, t.count( {$and:[{a:'foo'}],$where:'this.a=="foo"'} ) );
|
||||
|
||||
// Nested where ok
|
||||
assert.eq( 1, t.count({$and:[{$where:'this.a=="foo"'}]}) );
|
||||
assert.eq( 1, t.count({$and:[{a:'foo'},{$where:'this.a=="foo"'}]}) );
|
||||
assert.eq( 1, t.count({$and:[{$where:'this.a=="foo"'}],$where:'this.a=="foo"'}) );
|
||||
}
|
||||
|
||||
check();
|
||||
t.ensureIndex( {a:1} );
|
||||
check();
|
||||
var e = t.find( {$and:[{a:1}]} ).explain();
|
||||
assert.eq( 'BtreeCursor a_1', e.cursor );
|
||||
assert.eq( [[1,1]], e.indexBounds.a );
|
||||
|
||||
function checkBounds( query ) {
|
||||
var e = t.find( query ).explain(true);
|
||||
printjson(e);
|
||||
assert.eq( 1, e.n );
|
||||
}
|
||||
|
||||
checkBounds( {a:1,$and:[{a:2}]} );
|
||||
checkBounds( {$and:[{a:1},{a:2}]} );
|
||||
@ -1,27 +0,0 @@
|
||||
// Test dollar sign operator with $and SERVER-1089
|
||||
|
||||
t = db.jstests_and2;
|
||||
|
||||
t.drop();
|
||||
t.save( {a:[1,2]} );
|
||||
t.update( {a:1}, {$set:{'a.$':5}} );
|
||||
assert.eq( [5,2], t.findOne().a );
|
||||
|
||||
t.drop();
|
||||
t.save( {a:[1,2]} );
|
||||
t.update( {$and:[{a:1}]}, {$set:{'a.$':5}} );
|
||||
assert.eq( [5,2], t.findOne().a );
|
||||
|
||||
// Make sure dollar sign operator with $and is consistent with no $and case
|
||||
t.drop();
|
||||
t.save( {a:[1,2],b:[3,4]} );
|
||||
t.update( {a:1,b:4}, {$set:{'a.$':5}} );
|
||||
// Probably not what we want here, just trying to make sure $and is consistent
|
||||
assert.eq( {a:[1,5],b:[3,4]}, t.find( {}, {_id:0} ).toArray()[ 0 ] );
|
||||
|
||||
// Make sure dollar sign operator with $and is consistent with no $and case
|
||||
t.drop();
|
||||
t.save( {a:[1,2],b:[3,4]} );
|
||||
t.update( {a:1,$and:[{b:4}]}, {$set:{'a.$':5}} );
|
||||
// Probably not what we want here, just trying to make sure $and is consistent
|
||||
assert.eq( {a:[1,5],b:[3,4]}, t.find( {}, {_id:0} ).toArray()[ 0 ] );
|
||||
@ -1,67 +0,0 @@
|
||||
// Check key match with sub matchers - part of SERVER-3192
|
||||
|
||||
t = db.jstests_and3;
|
||||
t.drop();
|
||||
|
||||
t.save( {a:1} );
|
||||
t.save( {a:'foo'} );
|
||||
|
||||
t.ensureIndex( {a:1} );
|
||||
|
||||
function checkScanMatch( query, nscannedObjects, n ) {
|
||||
var e = t.find( query ).hint( {a:1} ).explain();
|
||||
assert.eq( nscannedObjects, e.nscannedObjects );
|
||||
assert.eq( n, e.n );
|
||||
}
|
||||
|
||||
checkScanMatch( {a:/o/}, 1, 1 );
|
||||
checkScanMatch( {a:/a/}, 0, 0 );
|
||||
checkScanMatch( {a:{$not:/o/}}, 2, 1 );
|
||||
checkScanMatch( {a:{$not:/a/}}, 2, 2 );
|
||||
|
||||
checkScanMatch( {$and:[{a:/o/}]}, 1, 1 );
|
||||
checkScanMatch( {$and:[{a:/a/}]}, 0, 0 );
|
||||
checkScanMatch( {$and:[{a:{$not:/o/}}]}, 2, 1 );
|
||||
checkScanMatch( {$and:[{a:{$not:/a/}}]}, 2, 2 );
|
||||
checkScanMatch( {$and:[{a:/o/},{a:{$not:/o/}}]}, 1, 0 );
|
||||
checkScanMatch( {$and:[{a:/o/},{a:{$not:/a/}}]}, 1, 1 );
|
||||
checkScanMatch( {$or:[{a:/o/}]}, 1, 1 );
|
||||
checkScanMatch( {$or:[{a:/a/}]}, 0, 0 );
|
||||
checkScanMatch( {$nor:[{a:/o/}]}, 2, 1 );
|
||||
checkScanMatch( {$nor:[{a:/a/}]}, 2, 2 );
|
||||
|
||||
checkScanMatch( {$and:[{$and:[{a:/o/}]}]}, 1, 1 );
|
||||
checkScanMatch( {$and:[{$and:[{a:/a/}]}]}, 0, 0 );
|
||||
checkScanMatch( {$and:[{$and:[{a:{$not:/o/}}]}]}, 2, 1 );
|
||||
checkScanMatch( {$and:[{$and:[{a:{$not:/a/}}]}]}, 2, 2 );
|
||||
checkScanMatch( {$and:[{$or:[{a:/o/}]}]}, 1, 1 );
|
||||
checkScanMatch( {$and:[{$or:[{a:/a/}]}]}, 0, 0 );
|
||||
checkScanMatch( {$or:[{a:{$not:/o/}}]}, 2, 1 );
|
||||
checkScanMatch( {$and:[{$or:[{a:{$not:/o/}}]}]}, 2, 1 );
|
||||
checkScanMatch( {$and:[{$or:[{a:{$not:/a/}}]}]}, 2, 2 );
|
||||
checkScanMatch( {$and:[{$nor:[{a:/o/}]}]}, 2, 1 );
|
||||
checkScanMatch( {$and:[{$nor:[{a:/a/}]}]}, 2, 2 );
|
||||
|
||||
checkScanMatch( {$where:'this.a==1'}, 2, 1 );
|
||||
checkScanMatch( {$and:[{$where:'this.a==1'}]}, 2, 1 );
|
||||
|
||||
checkScanMatch( {a:1,$where:'this.a==1'}, 1, 1 );
|
||||
checkScanMatch( {a:1,$and:[{$where:'this.a==1'}]}, 1, 1 );
|
||||
checkScanMatch( {$and:[{a:1},{$where:'this.a==1'}]}, 1, 1 );
|
||||
checkScanMatch( {$and:[{a:1,$where:'this.a==1'}]}, 1, 1 );
|
||||
checkScanMatch( {a:1,$and:[{a:1},{a:1,$where:'this.a==1'}]}, 1, 1 );
|
||||
|
||||
function checkImpossibleMatch( query ) {
|
||||
var e = t.find( query ).explain();
|
||||
assert.eq( 0, e.n );
|
||||
// The explain output should include the indexBounds field.
|
||||
// The presence of the indexBounds field indicates that the
|
||||
// query can make use of an index.
|
||||
assert('indexBounds' in e, 'index bounds are missing');
|
||||
}
|
||||
|
||||
// With a single key index, all bounds are utilized.
|
||||
assert.eq( [[1,1]], t.find( {$and:[{a:1}]} ).explain().indexBounds.a );
|
||||
assert.eq( [[1,1]], t.find( {a:1,$and:[{a:1}]} ).explain().indexBounds.a );
|
||||
checkImpossibleMatch( {a:1,$and:[{a:2}]} );
|
||||
checkImpossibleMatch( {$and:[{a:1},{a:2}]} );
|
||||
@ -1,99 +0,0 @@
|
||||
// SERVER-1089 Test and/or nesting
|
||||
|
||||
t = db.jstests_andor;
|
||||
t.drop();
|
||||
|
||||
// not ok
|
||||
function ok( q ) {
|
||||
assert.eq( 1, t.find( q ).itcount() );
|
||||
}
|
||||
|
||||
t.save( {a:1} );
|
||||
|
||||
test = function() {
|
||||
|
||||
ok( {a:1} );
|
||||
|
||||
ok( {$and:[{a:1}]} );
|
||||
ok( {$or:[{a:1}]} );
|
||||
|
||||
ok( {$and:[{$and:[{a:1}]}]} );
|
||||
ok( {$or:[{$or:[{a:1}]}]} );
|
||||
|
||||
ok( {$and:[{$or:[{a:1}]}]} );
|
||||
ok( {$or:[{$and:[{a:1}]}]} );
|
||||
|
||||
ok( {$and:[{$and:[{$or:[{a:1}]}]}]} );
|
||||
ok( {$and:[{$or:[{$and:[{a:1}]}]}]} );
|
||||
ok( {$or:[{$and:[{$and:[{a:1}]}]}]} );
|
||||
|
||||
ok( {$or:[{$and:[{$or:[{a:1}]}]}]} );
|
||||
|
||||
// now test $nor
|
||||
|
||||
ok( {$and:[{a:1}]} );
|
||||
ok( {$nor:[{a:2}]} );
|
||||
|
||||
ok( {$and:[{$and:[{a:1}]}]} );
|
||||
ok( {$nor:[{$nor:[{a:1}]}]} );
|
||||
|
||||
ok( {$and:[{$nor:[{a:2}]}]} );
|
||||
ok( {$nor:[{$and:[{a:2}]}]} );
|
||||
|
||||
ok( {$and:[{$and:[{$nor:[{a:2}]}]}]} );
|
||||
ok( {$and:[{$nor:[{$and:[{a:2}]}]}]} );
|
||||
ok( {$nor:[{$and:[{$and:[{a:2}]}]}]} );
|
||||
|
||||
ok( {$nor:[{$and:[{$nor:[{a:1}]}]}]} );
|
||||
|
||||
}
|
||||
|
||||
test();
|
||||
t.ensureIndex( {a:1} );
|
||||
test();
|
||||
|
||||
// Test an inequality base match.
|
||||
|
||||
test = function() {
|
||||
|
||||
ok( {a:{$ne:2}} );
|
||||
|
||||
ok( {$and:[{a:{$ne:2}}]} );
|
||||
ok( {$or:[{a:{$ne:2}}]} );
|
||||
|
||||
ok( {$and:[{$and:[{a:{$ne:2}}]}]} );
|
||||
ok( {$or:[{$or:[{a:{$ne:2}}]}]} );
|
||||
|
||||
ok( {$and:[{$or:[{a:{$ne:2}}]}]} );
|
||||
ok( {$or:[{$and:[{a:{$ne:2}}]}]} );
|
||||
|
||||
ok( {$and:[{$and:[{$or:[{a:{$ne:2}}]}]}]} );
|
||||
ok( {$and:[{$or:[{$and:[{a:{$ne:2}}]}]}]} );
|
||||
ok( {$or:[{$and:[{$and:[{a:{$ne:2}}]}]}]} );
|
||||
|
||||
ok( {$or:[{$and:[{$or:[{a:{$ne:2}}]}]}]} );
|
||||
|
||||
// now test $nor
|
||||
|
||||
ok( {$and:[{a:{$ne:2}}]} );
|
||||
ok( {$nor:[{a:{$ne:1}}]} );
|
||||
|
||||
ok( {$and:[{$and:[{a:{$ne:2}}]}]} );
|
||||
ok( {$nor:[{$nor:[{a:{$ne:2}}]}]} );
|
||||
|
||||
ok( {$and:[{$nor:[{a:{$ne:1}}]}]} );
|
||||
ok( {$nor:[{$and:[{a:{$ne:1}}]}]} );
|
||||
|
||||
ok( {$and:[{$and:[{$nor:[{a:{$ne:1}}]}]}]} );
|
||||
ok( {$and:[{$nor:[{$and:[{a:{$ne:1}}]}]}]} );
|
||||
ok( {$nor:[{$and:[{$and:[{a:{$ne:1}}]}]}]} );
|
||||
|
||||
ok( {$nor:[{$and:[{$nor:[{a:{$ne:2}}]}]}]} );
|
||||
|
||||
}
|
||||
|
||||
t.drop();
|
||||
t.save( {a:1} );
|
||||
test();
|
||||
t.ensureIndex( {a:1} );
|
||||
test();
|
||||
@ -1,77 +0,0 @@
|
||||
/**
|
||||
* Tests for the db object enhancement
|
||||
*/
|
||||
|
||||
assert( "test" == db, "wrong database currently not test" );
|
||||
|
||||
dd = function( x ){
|
||||
//print( x );
|
||||
}
|
||||
|
||||
dd( "a" );
|
||||
|
||||
|
||||
dd( "b" );
|
||||
|
||||
/*
|
||||
* be sure the public collection API is complete
|
||||
*/
|
||||
assert(db.createCollection , "createCollection" );
|
||||
assert(db.getProfilingLevel , "getProfilingLevel" );
|
||||
assert(db.setProfilingLevel , "setProfilingLevel" );
|
||||
assert(db.dbEval , "dbEval" );
|
||||
assert(db.group , "group" );
|
||||
|
||||
dd( "c" );
|
||||
|
||||
/*
|
||||
* test createCollection
|
||||
*/
|
||||
|
||||
db.getCollection( "test" ).drop();
|
||||
db.getCollection( "system.namespaces" ).find().forEach( function(x) { assert(x.name != "test.test"); });
|
||||
|
||||
dd( "d" );
|
||||
|
||||
db.createCollection("test");
|
||||
var found = false;
|
||||
db.getCollection( "system.namespaces" ).find().forEach( function(x) { if (x.name == "test.test") found = true; });
|
||||
assert(found, "found test.test in system.namespaces");
|
||||
|
||||
dd( "e" );
|
||||
|
||||
/*
|
||||
* profile level
|
||||
*/
|
||||
|
||||
db.setProfilingLevel(0);
|
||||
assert(db.getProfilingLevel() == 0, "prof level 0");
|
||||
|
||||
db.setProfilingLevel(1);
|
||||
assert(db.getProfilingLevel() == 1, "p1");
|
||||
|
||||
db.setProfilingLevel(2);
|
||||
assert(db.getProfilingLevel() == 2, "p2");
|
||||
|
||||
db.setProfilingLevel(0);
|
||||
assert(db.getProfilingLevel() == 0, "prof level 0");
|
||||
|
||||
dd( "f" );
|
||||
asserted = false;
|
||||
try {
|
||||
db.setProfilingLevel(10);
|
||||
assert(false);
|
||||
}
|
||||
catch (e) {
|
||||
asserted = true;
|
||||
assert(e.dbSetProfilingException);
|
||||
}
|
||||
assert( asserted, "should have asserted" );
|
||||
|
||||
dd( "g" );
|
||||
|
||||
|
||||
|
||||
assert.eq( "foo" , db.getSisterDB( "foo" ).getName() )
|
||||
assert.eq( "foo" , db.getSiblingDB( "foo" ).getName() )
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
/**
|
||||
* Tests for the db collection
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* test drop
|
||||
*/
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).find().length() == 0,1);
|
||||
|
||||
db.getCollection( "test_db" ).save({a:1});
|
||||
assert(db.getCollection( "test_db" ).find().length() == 1,2);
|
||||
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).find().length() == 0,3);
|
||||
|
||||
/*
|
||||
* test count
|
||||
*/
|
||||
|
||||
assert(db.getCollection( "test_db" ).count() == 0,4);
|
||||
db.getCollection( "test_db" ).save({a:1});
|
||||
assert(db.getCollection( "test_db" ).count() == 1,5);
|
||||
for (i = 0; i < 100; i++) {
|
||||
db.getCollection( "test_db" ).save({a:1});
|
||||
}
|
||||
assert(db.getCollection( "test_db" ).count() == 101,6);
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).count() == 0,7);
|
||||
|
||||
/*
|
||||
* test clean (not sure... just be sure it doen't blow up, I guess
|
||||
*/
|
||||
|
||||
db.getCollection( "test_db" ).clean();
|
||||
|
||||
/*
|
||||
* test validate
|
||||
*/
|
||||
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).count() == 0,8);
|
||||
|
||||
for (i = 0; i < 100; i++) {
|
||||
db.getCollection( "test_db" ).save({a:1});
|
||||
}
|
||||
|
||||
var v = db.getCollection( "test_db" ).validate();
|
||||
if( v.ns != "test.test_db" ) {
|
||||
print("Error: wrong ns name");
|
||||
print(tojson(v));
|
||||
}
|
||||
assert (v.ns == "test.test_db",9);
|
||||
assert (v.ok == 1,10);
|
||||
|
||||
assert.eq(100,v.nrecords,11)
|
||||
|
||||
/*
|
||||
* test deleteIndex, deleteIndexes
|
||||
*/
|
||||
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).count() == 0,12);
|
||||
db.getCollection( "test_db" ).dropIndexes();
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 0,13);
|
||||
|
||||
db.getCollection( "test_db" ).save({a:10});
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 1,14);
|
||||
|
||||
db.getCollection( "test_db" ).ensureIndex({a:1});
|
||||
db.getCollection( "test_db" ).save({a:10});
|
||||
|
||||
print( tojson( db.getCollection( "test_db" ).getIndexes() ) );
|
||||
assert.eq(db.getCollection( "test_db" ).getIndexes().length , 2,15);
|
||||
|
||||
db.getCollection( "test_db" ).dropIndex({a:1});
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 1,16);
|
||||
|
||||
db.getCollection( "test_db" ).save({a:10});
|
||||
db.getCollection( "test_db" ).ensureIndex({a:1});
|
||||
db.getCollection( "test_db" ).save({a:10});
|
||||
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 2,17);
|
||||
|
||||
db.getCollection( "test_db" ).dropIndex("a_1");
|
||||
assert.eq( db.getCollection( "test_db" ).getIndexes().length , 1,18);
|
||||
|
||||
db.getCollection( "test_db" ).save({a:10, b:11});
|
||||
db.getCollection( "test_db" ).ensureIndex({a:1});
|
||||
db.getCollection( "test_db" ).ensureIndex({b:1});
|
||||
db.getCollection( "test_db" ).save({a:10, b:12});
|
||||
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 3,19);
|
||||
|
||||
db.getCollection( "test_db" ).dropIndex({b:1});
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 2,20);
|
||||
db.getCollection( "test_db" ).dropIndex({a:1});
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 1,21);
|
||||
|
||||
db.getCollection( "test_db" ).save({a:10, b:11});
|
||||
db.getCollection( "test_db" ).ensureIndex({a:1});
|
||||
db.getCollection( "test_db" ).ensureIndex({b:1});
|
||||
db.getCollection( "test_db" ).save({a:10, b:12});
|
||||
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 3,22);
|
||||
|
||||
db.getCollection( "test_db" ).dropIndexes();
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 1,23);
|
||||
|
||||
db.getCollection( "test_db" ).find();
|
||||
|
||||
db.getCollection( "test_db" ).drop();
|
||||
assert(db.getCollection( "test_db" ).getIndexes().length == 0,24);
|
||||
@ -1,66 +0,0 @@
|
||||
|
||||
t = db.apply_ops1;
|
||||
t.drop();
|
||||
|
||||
assert.eq( 0 , t.find().count() , "A0" );
|
||||
a = db.adminCommand( { applyOps : [ { "op" : "i" , "ns" : t.getFullName() , "o" : { _id : 5 , x : 17 } } ] } )
|
||||
assert.eq( 1 , t.find().count() , "A1a" );
|
||||
assert.eq( true, a.results[0], "A1b" );
|
||||
|
||||
o = { _id : 5 , x : 17 }
|
||||
assert.eq( o , t.findOne() , "A2" );
|
||||
|
||||
res = db.runCommand( { applyOps : [
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } } ,
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } }
|
||||
] } )
|
||||
|
||||
o.x++;
|
||||
o.x++;
|
||||
|
||||
assert.eq( 1 , t.find().count() , "A3" );
|
||||
assert.eq( o , t.findOne() , "A4" );
|
||||
assert.eq( true, res.results[0], "A1b" );
|
||||
assert.eq( true, res.results[1], "A1b" );
|
||||
|
||||
|
||||
res = db.runCommand( { applyOps :
|
||||
[
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } } ,
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } }
|
||||
]
|
||||
,
|
||||
preCondition : [ { ns : t.getFullName() , q : { _id : 5 } , res : { x : 19 } } ]
|
||||
} );
|
||||
|
||||
o.x++;
|
||||
o.x++;
|
||||
|
||||
assert.eq( 1 , t.find().count() , "B1" );
|
||||
assert.eq( o , t.findOne() , "B2" );
|
||||
assert.eq( true, res.results[0], "B2a" );
|
||||
assert.eq( true, res.results[1], "B2b" );
|
||||
|
||||
|
||||
res = db.runCommand( { applyOps :
|
||||
[
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } } ,
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } }
|
||||
]
|
||||
,
|
||||
preCondition : [ { ns : t.getFullName() , q : { _id : 5 } , res : { x : 19 } } ]
|
||||
} );
|
||||
|
||||
assert.eq( 1 , t.find().count() , "B3" );
|
||||
assert.eq( o , t.findOne() , "B4" );
|
||||
|
||||
res = db.runCommand( { applyOps :
|
||||
[
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 5 } , "o" : { $inc : { x : 1 } } } ,
|
||||
{ "op" : "u" , "ns" : t.getFullName() , "o2" : { _id : 6 } , "o" : { $inc : { x : 1 } } }
|
||||
]
|
||||
} );
|
||||
|
||||
assert.eq( true, res.results[0], "B5" );
|
||||
assert.eq( true, res.results[1], "B6" );
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
//Test applyops upsert flag SERVER-7452
|
||||
|
||||
var t = db.apply_ops2;
|
||||
t.drop();
|
||||
|
||||
assert.eq(0, t.find().count(), "test collection not empty");
|
||||
|
||||
t.insert({_id:1, x:"init"});
|
||||
|
||||
//alwaysUpsert = true
|
||||
print("Testing applyOps with alwaysUpsert = true");
|
||||
|
||||
var res = db.runCommand({ applyOps: [
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2 : { _id: 1 },
|
||||
o: { $set: { x: "upsert=true existing" }}
|
||||
},
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2: { _id: 2 },
|
||||
o: { $set : { x: "upsert=true non-existing" }}
|
||||
}], alwaysUpsert: true });
|
||||
|
||||
assert.eq(true, res.results[0], "upsert = true, existing doc update failed");
|
||||
assert.eq(true, res.results[1], "upsert = true, nonexisting doc not upserted");
|
||||
assert.eq(2, t.find().count(), "2 docs expected after upsert");
|
||||
|
||||
//alwaysUpsert = false
|
||||
print("Testing applyOps with alwaysUpsert = false");
|
||||
|
||||
res = db.runCommand({ applyOps: [
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2: { _id: 1 },
|
||||
o: { $set : { x: "upsert=false existing" }}
|
||||
},
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2: { _id: 3 },
|
||||
o: { $set: { x: "upsert=false non-existing" }}
|
||||
}], alwaysUpsert: false });
|
||||
|
||||
assert.eq(true, res.results[0], "upsert = false, existing doc update failed");
|
||||
assert.eq(false, res.results[1], "upsert = false, nonexisting doc upserted");
|
||||
assert.eq(2, t.find().count(), "2 docs expected after upsert failure");
|
||||
|
||||
//alwaysUpsert not specified, should default to true
|
||||
print("Testing applyOps with default alwaysUpsert");
|
||||
|
||||
res = db.runCommand({ applyOps: [
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2: { _id: 1 },
|
||||
o: { $set: { x: "upsert=default existing" }}
|
||||
},
|
||||
{
|
||||
op: "u",
|
||||
ns: t.getFullName(),
|
||||
o2: { _id: 4 },
|
||||
o: { $set: { x: "upsert=defaults non-existing" }}
|
||||
}]});
|
||||
|
||||
assert.eq(true, res.results[0], "default upsert, existing doc update failed");
|
||||
assert.eq(true, res.results[1], "default upsert, nonexisting doc not upserted");
|
||||
assert.eq(3, t.find().count(), "2 docs expected after upsert failure");
|
||||
@ -1,14 +0,0 @@
|
||||
t = db.array1
|
||||
t.drop()
|
||||
|
||||
x = { a : [ 1 , 2 ] };
|
||||
|
||||
t.save( { a : [ [1,2] ] } );
|
||||
assert.eq( 1 , t.find( x ).count() , "A" );
|
||||
|
||||
t.save( x );
|
||||
delete x._id;
|
||||
assert.eq( 2 , t.find( x ).count() , "B" );
|
||||
|
||||
t.ensureIndex( { a : 1 } );
|
||||
assert.eq( 2 , t.find( x ).count() , "C" ); // TODO SERVER-146
|
||||
@ -1,8 +0,0 @@
|
||||
|
||||
assert.eq( 5 , Array.sum( [ 1 , 4 ] ), "A" )
|
||||
assert.eq( 2.5 , Array.avg( [ 1 , 4 ] ), "B" )
|
||||
|
||||
arr = [ 2 , 4 , 4 , 4 , 5 , 5 , 7 , 9 ]
|
||||
assert.eq( 5 , Array.avg( arr ) , "C" )
|
||||
assert.eq( 2 , Array.stdDev( arr ) , "D" )
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
|
||||
t = db.array4;
|
||||
t.drop();
|
||||
|
||||
t.insert({"a": ["1", "2", "3"]});
|
||||
t.insert({"a" : ["2", "1"]});
|
||||
|
||||
var x = {'a.0' : /1/};
|
||||
|
||||
assert.eq(t.count(x), 1);
|
||||
|
||||
assert.eq(t.findOne(x).a[0], 1);
|
||||
assert.eq(t.findOne(x).a[1], 2);
|
||||
|
||||
t.drop();
|
||||
|
||||
t.insert({"a" : {"0" : "1"}});
|
||||
t.insert({"a" : ["2", "1"]});
|
||||
|
||||
assert.eq(t.count(x), 1);
|
||||
assert.eq(t.findOne(x).a[0], 1);
|
||||
|
||||
t.drop();
|
||||
|
||||
t.insert({"a" : ["0", "1", "2", "3", "4", "5", "6", "1", "1", "1", "2", "3", "2", "1"]});
|
||||
t.insert({"a" : ["2", "1"]});
|
||||
|
||||
x = {"a.12" : /2/};
|
||||
assert.eq(t.count(x), 1);
|
||||
assert.eq(t.findOne(x).a[0], 0);
|
||||
@ -1,31 +0,0 @@
|
||||
|
||||
t = db.array_match1
|
||||
t.drop();
|
||||
|
||||
t.insert( { _id : 1 , a : [ 5 , 5 ] } )
|
||||
t.insert( { _id : 2 , a : [ 6 , 6 ] } )
|
||||
t.insert( { _id : 3 , a : [ 5 , 5 ] } )
|
||||
|
||||
function test( f , m ){
|
||||
var q = {};
|
||||
|
||||
q[f] = [5,5];
|
||||
assert.eq( 2 , t.find( q ).itcount() , m + "1" )
|
||||
|
||||
q[f] = [6,6];
|
||||
assert.eq( 1 , t.find( q ).itcount() , m + "2" )
|
||||
}
|
||||
|
||||
test( "a" , "A" );
|
||||
t.ensureIndex( { a : 1 } )
|
||||
test( "a" , "B" );
|
||||
|
||||
t.drop();
|
||||
|
||||
t.insert( { _id : 1 , a : { b : [ 5 , 5 ] } } )
|
||||
t.insert( { _id : 2 , a : { b : [ 6 , 6 ] } } )
|
||||
t.insert( { _id : 3 , a : { b : [ 5 , 5 ] } } )
|
||||
|
||||
test( "a.b" , "C" );
|
||||
t.ensureIndex( { a : 1 } )
|
||||
test( "a.b" , "D" );
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
t = db.jstests_array_match2;
|
||||
t.drop();
|
||||
|
||||
t.save( {a:[{1:4},5]} );
|
||||
// When the array index is the last field, both of these match types work.
|
||||
assert.eq( 1, t.count( {'a.1':4} ) );
|
||||
assert.eq( 1, t.count( {'a.1':5} ) );
|
||||
|
||||
t.remove({});
|
||||
// When the array index is not the last field, only one of the match types works.
|
||||
t.save( {a:[{1:{foo:4}},{foo:5}]} );
|
||||
assert.eq( 1, t.count( {'a.1.foo':4} ) );
|
||||
assert.eq( 1, t.count( {'a.1.foo':5} ) );
|
||||
|
||||
// Same issue with the $exists operator
|
||||
t.remove({});
|
||||
t.save( {a:[{1:{foo:4}},{}]} );
|
||||
assert.eq( 1, t.count( {'a.1':{$exists:true}} ) );
|
||||
assert.eq( 1, t.count( {'a.1.foo':{$exists:true}} ) );
|
||||
@ -1,13 +0,0 @@
|
||||
// SERVER-2902 Test indexing of numerically referenced array elements.
|
||||
|
||||
t = db.jstests_array_match3;
|
||||
t.drop();
|
||||
|
||||
// Test matching numericallly referenced array element.
|
||||
t.save( {a:{'0':5}} );
|
||||
t.save( {a:[5]} );
|
||||
assert.eq( 2, t.count( {'a.0':5} ) );
|
||||
|
||||
// Test with index.
|
||||
t.ensureIndex( {'a.0':1} );
|
||||
assert.eq( 2, t.count( {'a.0':5} ) );
|
||||
@ -1,30 +0,0 @@
|
||||
var t = db.array_match4;
|
||||
|
||||
t.drop();
|
||||
t.save({a: [1, 2]});
|
||||
|
||||
var query_gte = {a: {$gte: [1, 2]}};
|
||||
|
||||
//
|
||||
// without index
|
||||
//
|
||||
|
||||
assert.eq(1, t.find({a: [1, 2]}).count(), '$eq (without index)');
|
||||
assert.eq(1, t.find(query_gte).itcount(), '$gte (without index)');
|
||||
|
||||
//
|
||||
// with index
|
||||
//
|
||||
|
||||
t.ensureIndex({a: 1});
|
||||
assert.eq(1, t.find({a: [1, 2]}).count(), '$eq (with index)');
|
||||
|
||||
// display explain output (for index bounds)
|
||||
var explain = t.find(query_gte).explain();
|
||||
print('explain for ' + tojson(query_gte, '', true) + ' = ' + tojson(explain));
|
||||
|
||||
// number of documents returned by indexes query should be consistent
|
||||
// with non-indexed case.
|
||||
// XXX: The following assertion documents current behavior.
|
||||
// XXX: 2.4 and 2.6 both return 0 documents.
|
||||
assert.eq(0, t.find(query_gte).itcount(), '$gte (with index)');
|
||||
@ -1,40 +0,0 @@
|
||||
|
||||
t = db.arrayfind1;
|
||||
t.drop();
|
||||
|
||||
t.save( { a : [ { x : 1 } ] } )
|
||||
t.save( { a : [ { x : 1 , y : 2 , z : 1 } ] } )
|
||||
t.save( { a : [ { x : 1 , y : 1 , z : 3 } ] } )
|
||||
|
||||
function test( exptected , q , name ){
|
||||
assert.eq( exptected , t.find( q ).itcount() , name + " " + tojson( q ) + " itcount" );
|
||||
assert.eq( exptected , t.find( q ).count() , name + " " + tojson( q ) + " count" );
|
||||
}
|
||||
|
||||
test( 3 , {} , "A1" );
|
||||
test( 1 , { "a.y" : 2 } , "A2" );
|
||||
test( 1 , { "a" : { x : 1 } } , "A3" );
|
||||
test( 3 , { "a" : { $elemMatch : { x : 1 } } } , "A4" ); // SERVER-377
|
||||
|
||||
|
||||
t.save( { a : [ { x : 2 } ] } )
|
||||
t.save( { a : [ { x : 3 } ] } )
|
||||
t.save( { a : [ { x : 4 } ] } )
|
||||
|
||||
assert.eq( 1 , t.find( { a : { $elemMatch : { x : 2 } } } ).count() , "B1" );
|
||||
assert.eq( 2 , t.find( { a : { $elemMatch : { x : { $gt : 2 } } } } ).count() , "B2" );
|
||||
|
||||
t.ensureIndex( { "a.x" : 1 } );
|
||||
assert( t.find( { "a" : { $elemMatch : { x : 1 } } } ).explain().cursor.indexOf( "BtreeC" ) == 0 , "C1" );
|
||||
|
||||
assert.eq( 1 , t.find( { a : { $elemMatch : { x : 2 } } } ).count() , "D1" );
|
||||
|
||||
t.find( { "a.x" : 1 } ).count();
|
||||
t.find( { "a.x" : { $gt : 1 } } ).count();
|
||||
|
||||
res = t.find( { "a" : { $elemMatch : { x : { $gt : 2 } } } } ).explain()
|
||||
assert( res.cursor.indexOf( "BtreeC" ) == 0 , "D2" );
|
||||
assert.eq( 2 , t.find( { a : { $elemMatch : { x : { $gt : 2 } } } } ).count() , "D3" );
|
||||
|
||||
assert.eq( 2 , t.find( { a : { $ne:2, $elemMatch : { x : { $gt : 2 } } } } ).count() , "E1" );
|
||||
assert( t.find( { a : { $ne:2, $elemMatch : { x : { $gt : 2 } } } } ).explain().cursor.indexOf( "BtreeC" ) == 0 , "E2" );
|
||||
@ -1,29 +0,0 @@
|
||||
|
||||
t = db.arrayfind2;
|
||||
t.drop();
|
||||
|
||||
function go( prefix ){
|
||||
assert.eq( 3 , t.count() , prefix + " A1" );
|
||||
assert.eq( 3 , t.find( { a : { $elemMatch : { x : { $gt : 4 } } } } ).count() , prefix + " A2" );
|
||||
assert.eq( 1 , t.find( { a : { $elemMatch : { x : { $lt : 2 } } } } ).count() , prefix + " A3" );
|
||||
assert.eq( 1 , t.find( { a : { $all : [ { $elemMatch : { x : { $lt : 4 } } } ,
|
||||
{ $elemMatch : { x : { $gt : 5 } } } ] } } ).count() , prefix + " A4" );
|
||||
|
||||
assert.throws( function() { return t.findOne( { a : { $all : [ 1, { $elemMatch : { x : 3 } } ] } } ) } );
|
||||
assert.throws( function() { return t.findOne( { a : { $all : [ /a/, { $elemMatch : { x : 3 } } ] } } ) } );
|
||||
|
||||
}
|
||||
|
||||
t.save( { a : [ { x : 1 } , { x : 5 } ] } )
|
||||
t.save( { a : [ { x : 3 } , { x : 5 } ] } )
|
||||
t.save( { a : [ { x : 3 } , { x : 6 } ] } )
|
||||
|
||||
go( "no index" );
|
||||
t.ensureIndex( { a : 1 } );
|
||||
go( "index(a)" );
|
||||
|
||||
t.ensureIndex( { "a.x": 1 } );
|
||||
|
||||
assert.eq( {"a.x":[[3,3]]}, t.find( { a : { $all : [ { $elemMatch : { x : 3 } } ] } } ).explain().indexBounds );
|
||||
// only first $elemMatch used to find bounds
|
||||
assert.eq( {"a.x":[[3,3]]}, t.find( { a : { $all : [ { $elemMatch : { x : 3 } }, { $elemMatch : { y : 5 } } ] } } ).explain().indexBounds );
|
||||
@ -1,16 +0,0 @@
|
||||
|
||||
t = db.arrayfind3;
|
||||
t.drop()
|
||||
|
||||
t.save({a:[1,2]})
|
||||
t.save({a:[1, 2, 6]})
|
||||
t.save({a:[1, 4, 6]})
|
||||
|
||||
|
||||
assert.eq( 2 , t.find( {a:{$gte:3, $lte: 5}} ).itcount() , "A1" )
|
||||
assert.eq( 1 , t.find( {a:{$elemMatch:{$gte:3, $lte: 5}}} ).itcount() , "A2" )
|
||||
|
||||
t.ensureIndex( { a : 1 } )
|
||||
|
||||
assert.eq( 2 , t.find( {a:{$gte:3, $lte: 5}} ).itcount() , "B1" );
|
||||
assert.eq( 1 , t.find( {a:{$elemMatch:{$gte:3, $lte: 5}}} ).itcount() , "B2" )
|
||||
@ -1,22 +0,0 @@
|
||||
// Test query empty array SERVER-2258
|
||||
|
||||
t = db.jstests_arrayfind4;
|
||||
t.drop();
|
||||
|
||||
t.save( {a:[]} );
|
||||
t.ensureIndex( {a:1} );
|
||||
|
||||
assert.eq( 1, t.find( {a:[]} ).hint( {$natural:1} ).itcount() );
|
||||
assert.eq( 1, t.find( {a:[]} ).hint( {a:1} ).itcount() );
|
||||
|
||||
assert.eq( 1, t.find( {a:{$in:[[]]}} ).hint( {$natural:1} ).itcount() );
|
||||
assert.eq( 1, t.find( {a:{$in:[[]]}} ).hint( {a:1} ).itcount() );
|
||||
|
||||
t.remove({});
|
||||
t.save( {a:[[]]} );
|
||||
|
||||
assert.eq( 1, t.find( {a:[]} ).hint( {$natural:1} ).itcount() );
|
||||
assert.eq( 1, t.find( {a:[]} ).hint( {a:1} ).itcount() );
|
||||
|
||||
assert.eq( 1, t.find( {a:{$in:[[]]}} ).hint( {$natural:1} ).itcount() );
|
||||
assert.eq( 1, t.find( {a:{$in:[[]]}} ).hint( {a:1} ).itcount() );
|
||||
@ -1,23 +0,0 @@
|
||||
// Test indexed elemmatch of missing field.
|
||||
|
||||
t = db.jstests_arrayfind5;
|
||||
t.drop();
|
||||
|
||||
function check( nullElemMatch ) {
|
||||
assert.eq( 1, t.find( {'a.b':1} ).itcount() );
|
||||
assert.eq( 1, t.find( {a:{$elemMatch:{b:1}}} ).itcount() );
|
||||
assert.eq( nullElemMatch ? 1 : 0 , t.find( {'a.b':null} ).itcount() );
|
||||
assert.eq( nullElemMatch ? 1 : 0, t.find( {a:{$elemMatch:{b:null}}} ).itcount() ); // see SERVER-3377
|
||||
}
|
||||
|
||||
t.save( {a:[{},{b:1}]} );
|
||||
check( true );
|
||||
t.ensureIndex( {'a.b':1} );
|
||||
check( true );
|
||||
|
||||
t.drop();
|
||||
|
||||
t.save( {a:[5,{b:1}]} );
|
||||
check( false );
|
||||
t.ensureIndex( {'a.b':1} );
|
||||
check( false );
|
||||
@ -1,26 +0,0 @@
|
||||
// Check index bound determination for $not:$elemMatch queries. SERVER-5740
|
||||
|
||||
t = db.jstests_arrayfind6;
|
||||
t.drop();
|
||||
|
||||
t.save( { a:[ { b:1, c:2 } ] } );
|
||||
|
||||
function checkElemMatchMatches() {
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ b:1, c:2 } } } ) );
|
||||
assert.eq( 0, t.count( { a:{ $not:{ $elemMatch:{ b:1, c:2 } } } } ) );
|
||||
assert.eq( 1, t.count( { a:{ $not:{ $elemMatch:{ b:1, c:3 } } } } ) );
|
||||
assert.eq( 1, t.count( { a:{ $not:{ $elemMatch:{ b:{ $ne:1 }, c:3 } } } } ) );
|
||||
// Index bounds must be determined for $not:$elemMatch, not $not:$ne. In this case if index
|
||||
// bounds are determined for $not:$ne, the a.b index will be constrained to the interval [2,2]
|
||||
// and the saved document will not be matched as it should.
|
||||
assert.eq( 1, t.count( { a:{ $not:{ $elemMatch:{ b:{ $ne:2 }, c:3 } } } } ) );
|
||||
}
|
||||
|
||||
checkElemMatchMatches();
|
||||
t.ensureIndex( { 'a.b':1 } );
|
||||
checkElemMatchMatches();
|
||||
|
||||
// We currently never use an index for negations of
|
||||
// ELEM_MATCH_OBJECT expressions.
|
||||
var explain = t.find( { a:{ $not:{ $elemMatch:{ b:{ $ne:2 }, c:3 } } } } ).explain();
|
||||
assert.eq( "BasicCursor", explain.cursor );
|
||||
@ -1,52 +0,0 @@
|
||||
// Nested $elemMatch clauses. SERVER-5741
|
||||
|
||||
t = db.jstests_arrayfind7;
|
||||
t.drop();
|
||||
|
||||
t.save( { a:[ { b:[ { c:1, d:2 } ] } ] } );
|
||||
|
||||
function checkElemMatchMatches() {
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ b:{ $elemMatch:{ c:1, d:2 } } } } } ) );
|
||||
}
|
||||
|
||||
// The document is matched using nested $elemMatch expressions, with and without an index.
|
||||
checkElemMatchMatches();
|
||||
t.ensureIndex( { 'a.b.c':1 } );
|
||||
checkElemMatchMatches();
|
||||
|
||||
function checkElemMatch( index, document, query ) {
|
||||
// The document is matched without an index, and with single and multi key indexes.
|
||||
t.drop();
|
||||
t.save( document );
|
||||
assert.eq( 1, t.count( query ) );
|
||||
t.ensureIndex( index );
|
||||
assert.eq( 1, t.count( query ) );
|
||||
t.save( { a:{ b:{ c:[ 10, 11 ] } } } ); // Make the index multikey.
|
||||
assert.eq( 1, t.count( query ) );
|
||||
}
|
||||
|
||||
// Two constraints within a nested $elemMatch expression.
|
||||
checkElemMatch( { 'a.b.c':1 },
|
||||
{ a:[ { b:[ { c:1 } ] } ] },
|
||||
{ a:{ $elemMatch:{ b:{ $elemMatch:{ c:{ $gte:1, $lte:1 } } } } } });
|
||||
|
||||
// Two constraints within a nested $elemMatch expression, one of which contains the other.
|
||||
checkElemMatch( { 'a.b.c':1 },
|
||||
{ a:[ { b:[ { c:2 } ] } ] },
|
||||
{ a:{ $elemMatch:{ b:{ $elemMatch:{ c:{ $gte:1, $in:[2] } } } } } });
|
||||
|
||||
// Two nested $elemMatch expressions.
|
||||
checkElemMatch( { 'a.d.e':1, 'a.b.c':1 },
|
||||
{ a:[ { b:[ { c:1 } ], d:[ { e:1 } ] } ] },
|
||||
{ a:{ $elemMatch:{ d:{ $elemMatch:{ e:{ $lte:1 } } },
|
||||
b:{ $elemMatch:{ c:{ $gte:1 } } } } } });
|
||||
|
||||
// A non $elemMatch expression and a nested $elemMatch expression.
|
||||
checkElemMatch( { 'a.x':1, 'a.b.c':1 },
|
||||
{ a:[ { b:[ { c:1 } ], x:1 } ] },
|
||||
{ 'a.x':1, a:{ $elemMatch:{ b:{ $elemMatch:{ c:{ $gte:1 } } } } } });
|
||||
|
||||
// $elemMatch is applied directly to a top level field.
|
||||
checkElemMatch( { 'a.b.c':1 },
|
||||
{ a:[ { b:[ { c:[ 1 ] } ] } ] },
|
||||
{ a:{ $elemMatch:{ 'b.c':{ $elemMatch:{ $gte:1, $lte:1 } } } } });
|
||||
@ -1,175 +0,0 @@
|
||||
// Matching behavior for $elemMatch applied to a top level element.
|
||||
// SERVER-1264
|
||||
// SERVER-4180
|
||||
|
||||
t = db.jstests_arrayfind8;
|
||||
t.drop();
|
||||
|
||||
function debug( x ) {
|
||||
if ( debuggingEnabled = false ) {
|
||||
printjson( x );
|
||||
}
|
||||
}
|
||||
|
||||
/** Set index state for the test. */
|
||||
function setIndexKey( key ) {
|
||||
indexKey = key;
|
||||
indexSpec = {};
|
||||
indexSpec[ key ] = 1;
|
||||
}
|
||||
|
||||
setIndexKey( 'a' );
|
||||
|
||||
function indexBounds( query ) {
|
||||
debug( query );
|
||||
debug( t.find( query ).hint( indexSpec ).explain() );
|
||||
return t.find( query ).hint( indexSpec ).explain().indexBounds[ indexKey ];
|
||||
}
|
||||
|
||||
/** Check that the query results match the documents in the 'expected' array. */
|
||||
function assertResults( expected, query, context ) {
|
||||
debug( query );
|
||||
assert.eq( expected.length, t.count( query ), 'unexpected count in ' + context );
|
||||
results = t.find( query ).toArray();
|
||||
for( i in results ) {
|
||||
found = false;
|
||||
for( j in expected ) {
|
||||
if ( friendlyEqual( expected[ j ], results[ i ].a ) ) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
assert( found, 'unexpected result ' + results[ i ] + ' in ' + context );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check matching for different query types.
|
||||
* @param bothMatch - document matched by both standardQuery and elemMatchQuery
|
||||
* @param elemMatch - document matched by elemMatchQuery but not standardQuery
|
||||
* @param notElemMatch - document matched by standardQuery but not elemMatchQuery
|
||||
*/
|
||||
function checkMatch( bothMatch, elemMatch, nonElemMatch, standardQuery, elemMatchQuery, context ) {
|
||||
|
||||
function mayPush( arr, elt ) {
|
||||
if ( elt ) {
|
||||
arr.push( elt );
|
||||
}
|
||||
}
|
||||
|
||||
expectedStandardQueryResults = [];
|
||||
mayPush( expectedStandardQueryResults, bothMatch );
|
||||
mayPush( expectedStandardQueryResults, nonElemMatch );
|
||||
assertResults( expectedStandardQueryResults, standardQuery, context + ' standard query' );
|
||||
|
||||
expectedElemMatchQueryResults = [];
|
||||
mayPush( expectedElemMatchQueryResults, bothMatch );
|
||||
mayPush( expectedElemMatchQueryResults, elemMatch );
|
||||
assertResults( expectedElemMatchQueryResults, elemMatchQuery, context + ' elemMatch query' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check matching and for different query types.
|
||||
* @param subQuery - part of a query, to be provided as is for a standard query and within a
|
||||
* $elemMatch clause for a $elemMatch query
|
||||
* @param bothMatch - document matched by both standardQuery and elemMatchQuery
|
||||
* @param elemMatch - document matched by elemMatchQuery but not standardQuery
|
||||
* @param notElemMatch - document matched by standardQuery but not elemMatchQuery
|
||||
* @param additionalConstraints - additional query parameters not generated from @param subQuery
|
||||
*/
|
||||
function checkQuery( subQuery, bothMatch, elemMatch, nonElemMatch,
|
||||
additionalConstraints ) {
|
||||
t.drop();
|
||||
additionalConstraints = additionalConstraints || {};
|
||||
|
||||
// Construct standard and elemMatch queries from subQuery.
|
||||
firstSubQueryKey = Object.keySet( subQuery )[ 0 ];
|
||||
if ( firstSubQueryKey[ 0 ] == '$' ) {
|
||||
standardQuery = { $and:[ { a:subQuery }, additionalConstraints ] };
|
||||
}
|
||||
else {
|
||||
// If the subQuery contains a field rather than operators, append to the 'a' field.
|
||||
modifiedSubQuery = {};
|
||||
modifiedSubQuery[ 'a.' + firstSubQueryKey ] = subQuery[ firstSubQueryKey ];
|
||||
standardQuery = { $and:[ modifiedSubQuery, additionalConstraints ] };
|
||||
}
|
||||
elemMatchQuery = { $and:[ { a:{ $elemMatch:subQuery } }, additionalConstraints ] };
|
||||
debug( elemMatchQuery );
|
||||
|
||||
function maySave( aValue ) {
|
||||
if ( aValue ) {
|
||||
debug( { a:aValue } );
|
||||
t.save( { a:aValue } );
|
||||
}
|
||||
}
|
||||
|
||||
// Save all documents and check matching without indexes.
|
||||
maySave( bothMatch );
|
||||
maySave( elemMatch );
|
||||
maySave( nonElemMatch );
|
||||
|
||||
checkMatch( bothMatch, elemMatch, nonElemMatch, standardQuery, elemMatchQuery, 'unindexed' );
|
||||
|
||||
// Check matching and index bounds for a single key index.
|
||||
|
||||
t.drop();
|
||||
maySave( bothMatch );
|
||||
maySave( elemMatch );
|
||||
// The nonElemMatch document is not tested here, as it will often make the index multikey.
|
||||
t.ensureIndex( indexSpec );
|
||||
checkMatch( bothMatch, elemMatch, null, standardQuery, elemMatchQuery, 'single key index' );
|
||||
|
||||
// Check matching and index bounds for a multikey index.
|
||||
|
||||
// Now the nonElemMatch document is tested.
|
||||
maySave( nonElemMatch );
|
||||
// Force the index to be multikey.
|
||||
t.save( { a:[ -1, -2 ] } );
|
||||
t.save( { a:{ b:[ -1, -2 ] } } );
|
||||
checkMatch( bothMatch, elemMatch, nonElemMatch, standardQuery, elemMatchQuery,
|
||||
'multikey index' );
|
||||
}
|
||||
|
||||
maxNumber = Infinity;
|
||||
|
||||
// Basic test.
|
||||
checkQuery( { $gt:4 }, [ 5 ] );
|
||||
|
||||
// Multiple constraints within a $elemMatch clause.
|
||||
checkQuery( { $gt:4, $lt:6 }, [ 5 ], null, [ 3, 7 ] );
|
||||
checkQuery( { $gt:4, $not:{ $gte:6 } }, [ 5 ] );
|
||||
checkQuery( { $gt:4, $not:{ $ne:6 } }, [ 6 ] );
|
||||
checkQuery( { $gte:5, $lte:5 }, [ 5 ], null, [ 4, 6 ] );
|
||||
checkQuery( { $in:[ 4, 6 ], $gt:5 }, [ 6 ], null, [ 4, 7 ] );
|
||||
checkQuery( { $regex:'^a' }, [ 'a' ] );
|
||||
|
||||
// Some constraints within a $elemMatch clause and other constraints outside of it.
|
||||
checkQuery( { $gt:4 }, [ 5 ], null, null, { a:{ $lt:6 } } );
|
||||
checkQuery( { $gte:5 }, [ 5 ], null, null, { a:{ $lte:5 } } );
|
||||
checkQuery( { $in:[ 4, 6 ] }, [ 6 ], null, null, { a:{ $gt:5 } } );
|
||||
|
||||
// Constraints in different $elemMatch clauses.
|
||||
checkQuery( { $gt:4 }, [ 5 ], null, null, { a:{ $elemMatch:{ $lt:6 } } } );
|
||||
checkQuery( { $gt:4 }, [ 3, 7 ], null, null, { a:{ $elemMatch:{ $lt:6 } } } );
|
||||
checkQuery( { $gte:5 }, [ 5 ], null, null, { a:{ $elemMatch:{ $lte:5 } } } );
|
||||
checkQuery( { $in:[ 4, 6 ] }, [ 6 ], null, null, { a:{ $elemMatch:{ $gt:5 } } } );
|
||||
|
||||
// TODO SERVER-1264
|
||||
if ( 0 ) {
|
||||
checkQuery( { $elemMatch:{ $in:[ 5 ] } }, null, [[ 5 ]], [ 5 ], null );
|
||||
}
|
||||
|
||||
setIndexKey( 'a.b' );
|
||||
checkQuery( { $elemMatch:{ b:{ $gte:1, $lte:1 } } }, null, [[ { b:1 } ]],
|
||||
[ { b:1 } ], null );
|
||||
checkQuery( { $elemMatch:{ b:{ $gte:1, $lte:1 } } }, null, [[ { b:[ 0, 2 ] } ]],
|
||||
[ { b:[ 0, 2 ] } ], null );
|
||||
|
||||
// Constraints for a top level (SERVER-1264 style) $elemMatch nested within a non top level
|
||||
// $elemMatch.
|
||||
checkQuery( { b:{ $elemMatch:{ $gte:1, $lte:1 } } }, [ { b:[ 1 ] } ] );
|
||||
checkQuery( { b:{ $elemMatch:{ $gte:1, $lte:4 } } }, [ { b:[ 1 ] } ] );
|
||||
|
||||
checkQuery( { b:{ $elemMatch:{ $gte:1, $lte:4 } } }, [ { b:[ 2 ] } ], null,
|
||||
null, { 'a.b':{ $in:[ 2, 5 ] } } );
|
||||
checkQuery( { b:{ $elemMatch:{ $in:[ 1, 2 ] }, $in:[ 2, 3 ] } },
|
||||
[ { b:[ 2 ] } ], null, [ { b:[ 1 ] }, { b:[ 3 ] } ], null );
|
||||
@ -1,34 +0,0 @@
|
||||
// Assorted $elemMatch behavior checks.
|
||||
|
||||
t = db.jstests_arrayfind9;
|
||||
t.drop();
|
||||
|
||||
// Top level field $elemMatch:$not matching
|
||||
t.save( { a:[ 1 ] } );
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ $not:{ $ne:1 } } } } ) );
|
||||
|
||||
// Top level field object $elemMatch matching.
|
||||
t.drop();
|
||||
t.save( { a:[ {} ] } );
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ $gte:{} } } } ) );
|
||||
|
||||
// Top level field array $elemMatch matching.
|
||||
t.drop();
|
||||
t.save( { a:[ [] ] } );
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ $in:[ [] ] } } } ) );
|
||||
|
||||
// Matching by array index.
|
||||
t.drop();
|
||||
t.save( { a:[ [ 'x' ] ] } );
|
||||
assert.eq( 1, t.count( { a:{ $elemMatch:{ '0':'x' } } } ) );
|
||||
|
||||
// Matching multiple values of a nested array.
|
||||
t.drop();
|
||||
t.save( { a:[ { b:[ 0, 2 ] } ] } );
|
||||
t.ensureIndex( { a:1 } );
|
||||
t.ensureIndex( { 'a.b':1 } );
|
||||
plans = [ { $natural:1 }, { a:1 }, { 'a.b':1 } ];
|
||||
for( i in plans ) {
|
||||
p = plans[ i ];
|
||||
assert.eq( 1, t.find( { a:{ $elemMatch:{ b:{ $gte:1, $lte:1 } } } } ).hint( p ).itcount() );
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
// Assorted $elemMatch matching behavior checks.
|
||||
|
||||
t = db.jstests_arrayfinda;
|
||||
t.drop();
|
||||
|
||||
// $elemMatch only matches elements within arrays (a descriptive, not a normative test).
|
||||
t.save( { a:[ { b:1 } ] } );
|
||||
t.save( { a:{ b:1 } } );
|
||||
|
||||
function assertExpectedMatch( cursor ) {
|
||||
assert.eq( [ { b:1 } ], cursor.next().a );
|
||||
assert( !cursor.hasNext() );
|
||||
}
|
||||
|
||||
assertExpectedMatch( t.find( { a:{ $elemMatch:{ b:{ $gte:1 } } } } ) );
|
||||
assertExpectedMatch( t.find( { a:{ $elemMatch:{ b:1 } } } ) );
|
||||
|
||||
// $elemMatch is not used to perform key matching. SERVER-6001
|
||||
t.ensureIndex( { a:1 } );
|
||||
assertExpectedMatch( t.find( { a:{ $elemMatch:{ b:{ $gte:1 } } } } ).hint( { a:1 } ) );
|
||||
assertExpectedMatch( t.find( { a:{ $elemMatch:{ b:1 } } } ).hint( { a:1 } ) );
|
||||
@ -64,9 +64,8 @@ assert.eq( 1000, tRO.count() , "B1" );
|
||||
assert.eq( 1000, tRO.find().toArray().length , "B2" ); // make sure we have a getMore in play
|
||||
assert.commandWorked( dbRO.runCommand( {ismaster:1} ) , "B3" );
|
||||
|
||||
assert( !dbRO.getLastError() , "B4" );
|
||||
tRO.save( {} ); // fail
|
||||
assert( dbRO.getLastError() , "B5: " + tojson( dbRO.getLastErrorObj() ) );
|
||||
assert.writeError(tRO.save({}));
|
||||
|
||||
assert.eq( 1000, tRO.count() , "B6" );
|
||||
|
||||
assert.eq( 1000, tRO.group( p ).length , "C1" );
|
||||
|
||||
42
jstests/auth/auth_options.js
Normal file
42
jstests/auth/auth_options.js
Normal file
@ -0,0 +1,42 @@
|
||||
var baseName = "jstests_auth_auth_options";
|
||||
|
||||
load('jstests/libs/command_line/test_parsed_options.js');
|
||||
|
||||
jsTest.log("Testing \"auth\" command line option");
|
||||
var expectedResult = {
|
||||
"parsed" : {
|
||||
"security" : {
|
||||
"authorization" : "enabled"
|
||||
}
|
||||
}
|
||||
};
|
||||
testGetCmdLineOptsMongod({ auth : "" }, expectedResult);
|
||||
|
||||
jsTest.log("Testing \"noauth\" command line option");
|
||||
expectedResult = {
|
||||
"parsed" : {
|
||||
"security" : {
|
||||
"authorization" : "disabled"
|
||||
}
|
||||
}
|
||||
};
|
||||
testGetCmdLineOptsMongod({ noauth : "" }, expectedResult);
|
||||
|
||||
jsTest.log("Testing \"security.authorization\" config file option");
|
||||
expectedResult = {
|
||||
"parsed" : {
|
||||
"config" : "jstests/libs/config_files/enable_auth.json",
|
||||
"security" : {
|
||||
"authorization" : "enabled"
|
||||
}
|
||||
}
|
||||
};
|
||||
testGetCmdLineOptsMongod({ config : "jstests/libs/config_files/enable_auth.json" }, expectedResult);
|
||||
|
||||
jsTest.log("Testing with no explicit object check setting");
|
||||
expectedResult = {
|
||||
"parsed" : { }
|
||||
};
|
||||
testGetCmdLineOptsMongod({}, expectedResult);
|
||||
|
||||
print(baseName + " succeeded.");
|
||||
@ -99,9 +99,8 @@ var CLUSTER_PERM = { killOp: 1, currentOp: 1, fsync_unlock: 1, killCursor: 1, pr
|
||||
*
|
||||
* @param shouldPass {Boolean} true means that the operation should succeed.
|
||||
* @param opFunc {function()} a function object which contains the operation to perform.
|
||||
* @param db {DB?} an optional parameter that will be used to call getLastError if present.
|
||||
*/
|
||||
var checkErr = function(shouldPass, opFunc, db) {
|
||||
var checkErr = function(shouldPass, opFunc) {
|
||||
var success = true;
|
||||
|
||||
var exception = null;
|
||||
@ -112,17 +111,10 @@ var checkErr = function(shouldPass, opFunc, db) {
|
||||
success = false;
|
||||
}
|
||||
|
||||
var gle = null;
|
||||
if (db != null) {
|
||||
gle = db.getLastError();
|
||||
success = success && (gle == null);
|
||||
}
|
||||
|
||||
assert(success == shouldPass, 'expected shouldPass: ' + shouldPass +
|
||||
', got: ' + success +
|
||||
', op: ' + tojson(opFunc) +
|
||||
', exception: ' + tojson(exception) +
|
||||
', gle: ' + tojson(gle));
|
||||
', exception: ' + tojson(exception));
|
||||
};
|
||||
|
||||
/**
|
||||
@ -138,16 +130,19 @@ var checkErr = function(shouldPass, opFunc, db) {
|
||||
*/
|
||||
var testOps = function(db, allowedActions) {
|
||||
checkErr(allowedActions.hasOwnProperty('insert'), function() {
|
||||
db.user.insert({ y: 1 });
|
||||
}, db);
|
||||
var res = db.user.insert({ y: 1 });
|
||||
if (res.hasWriteError()) throw Error("insert failed: " + tojson(res.getRawResponse()));
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('update'), function() {
|
||||
db.user.update({ y: 1 }, { z: 3 });
|
||||
}, db);
|
||||
var res = db.user.update({ y: 1 }, { z: 3 });
|
||||
if (res.hasWriteError()) throw Error("update failed: " + tojson(res.getRawResponse()));
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('remove'), function() {
|
||||
db.user.remove({ y: 1 });
|
||||
}, db);
|
||||
var res = db.user.remove({ y: 1 });
|
||||
if (res.hasWriteError()) throw Error("remove failed: " + tojson(res.getRawResponse()));
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('query'), function() {
|
||||
db.user.findOne({ y: 1 });
|
||||
@ -174,16 +169,22 @@ var testOps = function(db, allowedActions) {
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('index_w'), function() {
|
||||
db.user.ensureIndex({ x: 1 });
|
||||
}, db);
|
||||
var res = db.user.ensureIndex({ x: 1 });
|
||||
if (res.code == 13) { // Unauthorized
|
||||
throw 'unauthorized currentOp';
|
||||
}
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('profile_r'), function() {
|
||||
db.system.profile.findOne();
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('profile_w'), function() {
|
||||
db.system.profile.insert({ x: 1 });
|
||||
}, db);
|
||||
var res = db.system.profile.insert({ x: 1 });
|
||||
if (res.hasWriteError()) {
|
||||
throw Error("profile insert failed: " + tojson(res.getRawResponse()));
|
||||
}
|
||||
});
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('user_r'), function() {
|
||||
var result = db.runCommand({usersInfo: 1});
|
||||
@ -194,8 +195,8 @@ var testOps = function(db, allowedActions) {
|
||||
|
||||
checkErr(allowedActions.hasOwnProperty('user_w'), function() {
|
||||
db.createUser({user:'a', pwd: 'a', roles: jsTest.basicUserRoles});
|
||||
db.dropUser('a');
|
||||
}, db);
|
||||
assert(db.dropUser('a'));
|
||||
});
|
||||
|
||||
// Test for kill cursor
|
||||
(function() {
|
||||
|
||||
@ -3,32 +3,6 @@
|
||||
// authentication.
|
||||
//
|
||||
// Regression test for SERVER-8144.
|
||||
|
||||
// Raises an exception if "status" is not a GetLastError object indicating success.
|
||||
function assertGLEOK(status) {
|
||||
assert(status.ok && status.err === null,
|
||||
"Expected OK status object; found " + tojson(status));
|
||||
}
|
||||
|
||||
// Raises an exception if "status" is not a GetLastError object indicating failure.
|
||||
function assertGLENotOK(status) {
|
||||
assert(status.ok && status.err !== null,
|
||||
"Expected not-OK status object; found " + tojson(status));
|
||||
}
|
||||
|
||||
// Asserts that inserting "obj" into "collection" succeeds.
|
||||
function assertInsertSucceeds(collection, obj) {
|
||||
collection.insert(obj);
|
||||
assertGLEOK(collection.getDB().getLastErrorObj());
|
||||
}
|
||||
|
||||
// Asserts that inserting "obj" into "collection" fails.
|
||||
function assertInsertFails(collection, obj) {
|
||||
collection.insert(obj);
|
||||
assertGLENotOK(collection.getDB().getLastErrorObj());
|
||||
}
|
||||
|
||||
|
||||
var conn = MongoRunner.runMongod({ auth: "", smallfiles: "" });
|
||||
var admin = conn.getDB("admin");
|
||||
var test = conn.getDB("test");
|
||||
@ -40,15 +14,15 @@ test.createUser({user: 'writer', pwd: 'a', roles: [ "readWrite" ]});
|
||||
admin.logout();
|
||||
|
||||
// Nothing logged in, can neither read nor write.
|
||||
assertInsertFails(test.docs, { value: 0 });
|
||||
assert.writeError(test.docs.insert({ value: 0 }));
|
||||
assert.throws(function() { test.foo.findOne() });
|
||||
|
||||
// Writer logged in, can read and write.
|
||||
test.auth('writer', 'a');
|
||||
assertInsertSucceeds(test.docs, { value: 1 });
|
||||
assert.writeOK(test.docs.insert({ value: 1 }));
|
||||
test.foo.findOne();
|
||||
|
||||
// Reader logged in, replacing writer, can only read.
|
||||
test.auth('reader', 'a');
|
||||
assertInsertFails(test.docs, { value: 2 });
|
||||
assert.writeError(test.docs.insert({ value: 2 }));
|
||||
test.foo.findOne();
|
||||
|
||||
@ -2,11 +2,6 @@
|
||||
// dropDups.
|
||||
var conn = MongoRunner.runMongod({auth : ""});
|
||||
|
||||
function assertGLENotOK(status) {
|
||||
assert(status.ok && status.err !== null,
|
||||
"Expected not-OK status object; found " + tojson(status));
|
||||
}
|
||||
|
||||
var adminDB = conn.getDB("admin");
|
||||
var testDB = conn.getDB("test");
|
||||
adminDB.createUser({user:'admin', pwd:'x', roles:['userAdminAnyDatabase']});
|
||||
@ -17,11 +12,14 @@ assert.eq(3, adminDB.system.users.count());
|
||||
adminDB.logout();
|
||||
|
||||
adminDB.auth('mallory', 'x');
|
||||
adminDB.system.users.createIndex({haxx:1}, {unique:true, dropDups:true});
|
||||
assertGLENotOK(adminDB.getLastErrorObj());
|
||||
adminDB.exploit.system.indexes.insert({ns: "admin.system.users", key: { haxx: 1.0 }, name: "haxx_1",
|
||||
unique: true, dropDups: true});
|
||||
assertGLENotOK(testDB.getLastErrorObj());
|
||||
var res = adminDB.system.users.createIndex({ haxx: 1 }, { unique: true, dropDups: true });
|
||||
assert(!res.ok);
|
||||
assert.eq(13, res.code); // unauthorized
|
||||
assert.writeError(adminDB.exploit.system.indexes.insert({ ns: "admin.system.users",
|
||||
key: { haxx: 1.0 },
|
||||
name: "haxx_1",
|
||||
unique: true,
|
||||
dropDups: true }));
|
||||
// Make sure that no indexes were built.
|
||||
assert.eq(null,
|
||||
adminDB.system.namespaces.findOne(
|
||||
@ -32,4 +30,4 @@ adminDB.logout();
|
||||
|
||||
adminDB.auth('admin','x');
|
||||
// Make sure that no users were actually dropped
|
||||
assert.eq(3, adminDB.system.users.count());
|
||||
assert.eq(3, adminDB.system.users.count());
|
||||
|
||||
@ -12,7 +12,6 @@ var test = conn.getDB("test");
|
||||
|
||||
// insert a single document and add two test users
|
||||
test.foo.insert({a:1});
|
||||
test.getLastError();
|
||||
assert.eq(1, test.foo.findOne().a);
|
||||
test.createUser({user:'a', pwd: 'a', roles: jsTest.basicUserRoles});
|
||||
test.createUser({user:'b', pwd: 'b', roles: jsTest.basicUserRoles});
|
||||
|
||||
@ -493,6 +493,7 @@ var authCommandsLib = {
|
||||
dbOwner: 1,
|
||||
clusterMonitor: 1,
|
||||
clusterAdmin: 1,
|
||||
backup: 1,
|
||||
root: 1,
|
||||
__system: 1
|
||||
},
|
||||
@ -508,6 +509,7 @@ var authCommandsLib = {
|
||||
dbAdminAnyDatabase: 1,
|
||||
clusterMonitor: 1,
|
||||
clusterAdmin: 1,
|
||||
backup: 1,
|
||||
root: 1,
|
||||
__system: 1
|
||||
},
|
||||
|
||||
@ -21,16 +21,12 @@ var assertCannotRunCommands = function(mongo) {
|
||||
var test = mongo.getDB("test");
|
||||
assert.throws( function() { test.system.users.findOne(); });
|
||||
|
||||
test.foo.save({_id:0});
|
||||
assert(test.getLastError());
|
||||
|
||||
assert.writeError(test.foo.save({ _id: 0 }));
|
||||
|
||||
assert.throws( function() { test.foo.findOne({_id:0}); });
|
||||
|
||||
test.foo.update({_id:0}, {$set:{x:20}});
|
||||
assert(test.getLastError());
|
||||
|
||||
test.foo.remove({_id:0});
|
||||
assert(test.getLastError());
|
||||
|
||||
assert.writeError(test.foo.update({ _id: 0 }, { $set: { x: 20 }}));
|
||||
assert.writeError(test.foo.remove({ _id: 0 }));
|
||||
|
||||
assert.throws(function() {
|
||||
test.foo.mapReduce(
|
||||
@ -47,15 +43,10 @@ var assertCanRunCommands = function(mongo) {
|
||||
// will throw on failure
|
||||
test.system.users.findOne();
|
||||
|
||||
test.foo.save({_id: 0});
|
||||
assert(test.getLastError() == null);
|
||||
|
||||
test.foo.update({_id: 0}, {$set:{x:20}});
|
||||
assert(test.getLastError() == null);
|
||||
|
||||
test.foo.remove({_id: 0});
|
||||
assert(test.getLastError() == null);
|
||||
|
||||
assert.writeOK(test.foo.save({ _id: 0 }));
|
||||
assert.writeOK(test.foo.update({ _id: 0 }, { $set: { x: 20 }}));
|
||||
assert.writeOK(test.foo.remove({ _id: 0 }));
|
||||
|
||||
test.foo.mapReduce(
|
||||
function() { emit(1, 1); },
|
||||
function(id, count) { return Array.sum(count); },
|
||||
|
||||
@ -4,6 +4,11 @@
|
||||
*/
|
||||
|
||||
var authzErrorCode = 13;
|
||||
var hasAuthzError = function (result) {
|
||||
assert(result.hasWriteError());
|
||||
assert.eq(authzErrorCode, result.getWriteError().code);
|
||||
};
|
||||
|
||||
var st = new ShardingTest({ shards: 2,
|
||||
config: 3,
|
||||
mongos: [{},
|
||||
@ -28,15 +33,17 @@ st.s0.getDB('admin').createRole({role: 'myRole',
|
||||
roles: [],
|
||||
privileges: [{resource: {cluster: true},
|
||||
actions: ['invalidateUserCache']}]});
|
||||
|
||||
st.s0.getDB('test').createUser({user: 'spencer',
|
||||
pwd: 'pwd',
|
||||
roles: ['read',
|
||||
{role: 'myRole', db: 'admin'},
|
||||
{role: 'userAdminAnyDatabase', db: 'admin'}]});
|
||||
st.s0.getDB('admin').logout();
|
||||
|
||||
var db1 = st.s0.getDB('test');
|
||||
db1.createUser({user: 'spencer', pwd: 'pwd', roles: ['read', {role: 'myRole', db: 'admin'}]});
|
||||
db1.auth('spencer', 'pwd');
|
||||
|
||||
var db2 = st.s1.getDB('test');
|
||||
db2.auth('spencer', 'pwd');
|
||||
|
||||
var db3 = st.s2.getDB('test');
|
||||
db3.auth('spencer', 'pwd');
|
||||
|
||||
@ -53,31 +60,26 @@ db3.auth('spencer', 'pwd');
|
||||
(function testGrantingPrivileges() {
|
||||
jsTestLog("Testing propagation of granting privileges");
|
||||
|
||||
db1.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db1, authzErrorCode);
|
||||
db2.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db2, authzErrorCode);
|
||||
db3.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db3, authzErrorCode);
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
hasAuthzError(db2.foo.update({}, { $inc: { a: 1 }}));
|
||||
hasAuthzError(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
|
||||
assert.eq(1, db1.foo.findOne().a);
|
||||
assert.eq(1, db2.foo.findOne().a);
|
||||
assert.eq(1, db3.foo.findOne().a);
|
||||
|
||||
|
||||
db1.getSiblingDB('admin').grantPrivilegesToRole("myRole",
|
||||
[{resource: {db: 'test', collection: ''},
|
||||
actions: ['update']}]);
|
||||
|
||||
// s0/db1 should update its cache instantly
|
||||
db1.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db1);
|
||||
assert.writeOK(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.eq(2, db1.foo.findOne().a);
|
||||
|
||||
// s1/db2 should update its cache in 30 seconds.
|
||||
assert.soon(function() {
|
||||
db2.foo.update({}, {$inc: {a:1}});
|
||||
if (db2.getLastError()) {
|
||||
var res = db2.foo.update({}, { $inc: { a: 1 }});
|
||||
if (res.hasWriteError()) {
|
||||
return false;
|
||||
}
|
||||
return db2.foo.findOne().a == 3;
|
||||
@ -87,8 +89,7 @@ db3.auth('spencer', 'pwd');
|
||||
|
||||
// We manually invalidate the cache on s2/db3.
|
||||
db3.adminCommand("invalidateUserCache");
|
||||
db3.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db3);
|
||||
assert.writeOK(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.eq(4, db3.foo.findOne().a);
|
||||
|
||||
})();
|
||||
@ -101,53 +102,69 @@ db3.auth('spencer', 'pwd');
|
||||
actions: ['update']}]);
|
||||
|
||||
// s0/db1 should update its cache instantly
|
||||
db1.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db1, authzErrorCode);
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
|
||||
// s1/db2 should update its cache in 30 seconds.
|
||||
assert.soon(function() {
|
||||
db2.foo.update({}, {$inc: {a:1}});
|
||||
return db2.getLastErrorObj().code == authzErrorCode;
|
||||
var res = db2.foo.update({}, { $inc: { a: 1 }});
|
||||
return res.hasWriteError() && res.getWriteError().code == authzErrorCode;
|
||||
},
|
||||
"Mongos did not update its user cache after 30 seconds",
|
||||
31 * 1000); // Give an extra 1 second to avoid races
|
||||
|
||||
// We manually invalidate the cache on s1/db3.
|
||||
db3.adminCommand("invalidateUserCache");
|
||||
db3.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db3, authzErrorCode);
|
||||
|
||||
hasAuthzError(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
})();
|
||||
|
||||
(function testModifyingUser() {
|
||||
jsTestLog("Testing propagation modifications to a user, rather than to a role");
|
||||
|
||||
db1.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db1, authzErrorCode);
|
||||
db2.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db2, authzErrorCode);
|
||||
db3.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db3, authzErrorCode);
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
hasAuthzError(db2.foo.update({}, { $inc: { a: 1 }}));
|
||||
hasAuthzError(db3.foo.update({}, { $inc: { a: 1}}));
|
||||
|
||||
db1.getSiblingDB('test').grantRolesToUser("spencer", ['readWrite']);
|
||||
|
||||
// s0/db1 should update its cache instantly
|
||||
db1.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db1);
|
||||
assert.writeOK(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
|
||||
// s1/db2 should update its cache in 30 seconds.
|
||||
assert.soon(function() {
|
||||
db2.foo.update({}, {$inc: {a:1}});
|
||||
return !db2.getLastError();
|
||||
return !db2.foo.update({}, { $inc: { a: 1 }}).hasWriteError();
|
||||
},
|
||||
"Mongos did not update its user cache after 30 seconds",
|
||||
31 * 1000); // Give an extra 1 second to avoid races
|
||||
|
||||
// We manually invalidate the cache on s1/db3.
|
||||
db3.adminCommand("invalidateUserCache");
|
||||
db3.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db3);
|
||||
assert.writeOK(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
})();
|
||||
|
||||
(function testConcurrentUserModification() {
|
||||
jsTestLog("Testing having 2 mongoses modify the same user at the same time"); // SERVER-13850
|
||||
|
||||
assert.writeOK(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.writeOK(db3.foo.update({}, { $inc: { a: 1}}));
|
||||
|
||||
db1.getSiblingDB('test').revokeRolesFromUser("spencer", ['readWrite']);
|
||||
|
||||
// At this point db3 still thinks "spencer" has readWrite. Use it to add a different role
|
||||
// and make sure it doesn't add back readWrite
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.writeOK(db3.foo.update({}, { $inc: { a: 1}}));
|
||||
|
||||
db3.getSiblingDB('test').grantRolesToUser("spencer", ['dbAdmin']);
|
||||
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
// modifying "spencer" should force db3 to update its cache entry for "spencer"
|
||||
hasAuthzError(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
|
||||
// Make sure nothing changes from invalidating the cache
|
||||
db1.adminCommand('invalidateUserCache');
|
||||
db3.adminCommand('invalidateUserCache');
|
||||
hasAuthzError(db1.foo.update({}, { $inc: { a: 1 }}));
|
||||
hasAuthzError(db3.foo.update({}, { $inc: { a: 1 }}));
|
||||
})();
|
||||
|
||||
(function testDroppingUser() {
|
||||
|
||||
@ -236,8 +236,7 @@ slave = rt.start(false, mongoOptions, true);
|
||||
var masterDB = master.getDB("admin");
|
||||
|
||||
// ensure that master/slave replication is up and running
|
||||
masterDB.foo.save({});
|
||||
masterDB.runCommand({getLastError: 1, w: 2, wtimeout: 5000});
|
||||
masterDB.foo.save({}, { writeConcern: { w: 2, wtimeout: 5000 }});
|
||||
masterDB.foo.drop();
|
||||
|
||||
authReplTest = AuthReplTest({
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
|
||||
function runTest(conn) {
|
||||
var authzErrorCode = 13;
|
||||
var hasAuthzError = function(result) {
|
||||
assert(result.hasWriteError());
|
||||
assert.eq(authzErrorCode, result.getWriteError().code);
|
||||
};
|
||||
|
||||
var userAdminConn = new Mongo(conn.host);
|
||||
var testUserAdmin = userAdminConn.getDB('test');
|
||||
@ -46,46 +50,36 @@ function runTest(conn) {
|
||||
|
||||
testUserAdmin.updateUser('testUser', {roles: [{role: 'adminRole', db: 'admin'}]});
|
||||
assert.throws(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
|
||||
testUserAdmin.updateUser('testUser', {roles: ['testRole1']});
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(0, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
testUserAdmin.updateUser('testUser', {roles: ['testRole2']});
|
||||
assert.throws(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
testUserAdmin.updateUser('testUser', {roles: ['testRole3']});
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(1, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(2, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
testUserAdmin.updateUser('testUser', {roles: [{role: 'testRole4', db: 'test'}]});
|
||||
assert.throws(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
})();
|
||||
|
||||
@ -95,10 +89,8 @@ function runTest(conn) {
|
||||
testUserAdmin.updateRole('testRole4',
|
||||
{roles: [{role: 'testRole2', db: 'test'}, "testRole2"]});
|
||||
assert.throws(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
testUserAdmin.updateRole('testRole4',
|
||||
@ -106,22 +98,18 @@ function runTest(conn) {
|
||||
actions: ['find']}]});
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(3, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
testUserAdmin.updateRole('testRole4', {roles: []});
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
@ -129,11 +117,9 @@ function runTest(conn) {
|
||||
adminUserAdmin.updateRole('adminRole', {roles: [{role: 'read', db: 'test'}]});
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
})();
|
||||
@ -149,11 +135,9 @@ function runTest(conn) {
|
||||
{role: 'testRole2', db: 'test'}]);
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
assert.eq(4, db.foo.count());
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(5, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, {$inc: {a:1}}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
assert.commandWorked(db.adminCommand('serverStatus'));
|
||||
@ -167,10 +151,8 @@ function runTest(conn) {
|
||||
{role: 'read', db: 'test'},
|
||||
{role: 'testRole2', db: 'test'}]);
|
||||
assert.throws(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
assert.commandFailedWithCode(db.adminCommand('serverStatus'), authzErrorCode);
|
||||
})();
|
||||
@ -184,11 +166,9 @@ function runTest(conn) {
|
||||
{resource: {db:"", collection: ""},
|
||||
actions: ['find']}]);
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.eq(5, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
assert.commandWorked(db.adminCommand('serverStatus'));
|
||||
@ -200,11 +180,9 @@ function runTest(conn) {
|
||||
{resource: {db: 'test', collection: 'foo'},
|
||||
actions: ['find']}]);
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db, authzErrorCode);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(6, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(2, db.foo.findOne().a);
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
assert.commandFailedWithCode(db.adminCommand('serverStatus'), authzErrorCode);
|
||||
@ -217,11 +195,9 @@ function runTest(conn) {
|
||||
[{resource: {db: 'test', collection: ''},
|
||||
actions: ['insert', 'update', 'find']}]);
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(7, db.foo.count());
|
||||
db.foo.update({}, {$inc: {a:1}}, false, true);
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}, false, true));
|
||||
assert.eq(2, db.foo.findOne().a);
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
assert.commandFailedWithCode(db.adminCommand('serverStatus'), authzErrorCode);
|
||||
@ -267,15 +243,13 @@ function runTest(conn) {
|
||||
testUserAdmin.grantRolesToUser('testUser', ['testRole4'])
|
||||
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db, authzErrorCode);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(8, db.foo.count());
|
||||
|
||||
assert.commandWorked(testUserAdmin.runCommand({dropRole: 'testRole2'}));
|
||||
|
||||
assert.doesNotThrow(function() {db.foo.findOne();});
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.eq(8, db.foo.count());
|
||||
|
||||
assert.eq(3, testUserAdmin.getRoles().length);
|
||||
|
||||
@ -54,8 +54,7 @@ with_mongod( ['--noauth'], function setupTest( mongod ) {
|
||||
somedb.createUser({user: 'frim', pwd: 'fram', roles: jsTest.basicUserRoles});
|
||||
somedb.data.drop();
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
somedb.data.insert( { val: i } );
|
||||
assert ( ! somedb.getLastError() );
|
||||
assert.writeOK(somedb.data.insert( { val: i } ));
|
||||
}
|
||||
admin.logout();
|
||||
} );
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
|
||||
function runTest(conn) {
|
||||
var authzErrorCode = 13;
|
||||
var hasAuthzError = function(result) {
|
||||
assert(result.hasWriteError());
|
||||
assert.eq(authzErrorCode, result.getWriteError().code);
|
||||
};
|
||||
|
||||
conn.getDB('admin').createUser({user: 'admin', pwd: 'pwd', roles: ['root']});
|
||||
conn.getDB('admin').auth('admin', 'pwd');
|
||||
@ -37,15 +41,13 @@ function runTest(conn) {
|
||||
|
||||
|
||||
// test CRUD
|
||||
testDB.foo.insert({a:1});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.insert({ a: 1 }));
|
||||
assert.throws(function() { testDB.foo.findOne()});
|
||||
|
||||
testUserAdmin.grantPrivilegesToRole('testRole1', [{resource: {db: 'test', collection: ''},
|
||||
actions:['find']}]);
|
||||
|
||||
testDB.foo.insert({a:1});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.insert({ a: 1 }));
|
||||
assert.doesNotThrow(function() { testDB.foo.findOne()});
|
||||
assert.eq(0, testDB.foo.count());
|
||||
assert.eq(0, testDB.foo.find().itcount());
|
||||
@ -53,50 +55,40 @@ function runTest(conn) {
|
||||
testUserAdmin.grantPrivilegesToRole('testRole1', [{resource: {db: 'test', collection: 'foo'},
|
||||
actions:['insert']}]);
|
||||
|
||||
testDB.foo.insert({a:1});
|
||||
assert.gleSuccess(testDB);
|
||||
assert.writeOK(testDB.foo.insert({ a: 1 }));
|
||||
assert.eq(1, testDB.foo.findOne().a)
|
||||
assert.eq(1, testDB.foo.count());
|
||||
assert.eq(1, testDB.foo.find().itcount());
|
||||
testDB.foo.update({a:1}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.update({ a: 1 }, { $inc: { a: 1 }}));
|
||||
assert.eq(1, testDB.foo.findOne().a)
|
||||
|
||||
testDB.bar.insert({a:1});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.bar.insert({ a: 1 }));
|
||||
assert.eq(0, testDB.bar.count());
|
||||
|
||||
adminUserAdmin.grantPrivilegesToRole('adminRole', [{resource: {db: '', collection: 'foo'},
|
||||
actions:['update']}]);
|
||||
testDB.foo.update({a:1}, {$inc: {a:1}});
|
||||
assert.gleSuccess(testDB);
|
||||
assert.writeOK(testDB.foo.update({ a: 1 }, { $inc: { a: 1 }}));
|
||||
assert.eq(2, testDB.foo.findOne().a)
|
||||
testDB.foo.update({b:1}, {$inc: {b:1}}, true); // upsert
|
||||
assert.gleSuccess(testDB);
|
||||
assert.writeOK(testDB.foo.update({ b: 1 }, { $inc: { b: 1 }}, true)); // upsert
|
||||
assert.eq(2, testDB.foo.count());
|
||||
assert.eq(2, testDB.foo.findOne({b: {$exists: true}}).b);
|
||||
testDB.foo.remove({b:2});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.remove({ b: 2 }));
|
||||
assert.eq(2, testDB.foo.count());
|
||||
|
||||
adminUserAdmin.grantPrivilegesToRole('adminRole', [{resource: {db: '', collection: ''},
|
||||
actions:['remove']}]);
|
||||
testDB.foo.remove({b:2});
|
||||
assert.gleSuccess(testDB);
|
||||
assert.writeOK(testDB.foo.remove({ b: 2 }));
|
||||
assert.eq(1, testDB.foo.count());
|
||||
|
||||
|
||||
// Test revoking privileges
|
||||
testUserAdmin.revokePrivilegesFromRole('testRole1', [{resource: {db: 'test', collection: 'foo'},
|
||||
actions:['insert']}]);
|
||||
testDB.foo.insert({a:1});
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.insert({ a: 1 }));
|
||||
assert.eq(1, testDB.foo.count());
|
||||
testDB.foo.update({a:2}, {$inc: {a:1}});
|
||||
assert.gleSuccess(testDB);
|
||||
assert.writeOK(testDB.foo.update({ a: 2 }, { $inc: { a: 1 }}));
|
||||
assert.eq(3, testDB.foo.findOne({a: {$exists: true}}).a);
|
||||
testDB.foo.update({c:1}, {$inc: {c:1}}, true); // upsert should fail
|
||||
assert.gleErrorCode(testDB, authzErrorCode);
|
||||
hasAuthzError(testDB.foo.update({ c: 1 }, { $inc: { c: 1 }}, true)); // upsert should fail
|
||||
assert.eq(1, testDB.foo.count());
|
||||
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ rstest.nodes.forEach(function (node) {
|
||||
// Verify that dropping roles propagates.
|
||||
rstest.getMaster().getDB("db1").dropRole("r2", { w: 2});
|
||||
rstest.nodes.forEach(function (node) {
|
||||
assert.throws(function() { node.getDB("db1").getRole("r2") }, [], node);
|
||||
assert.eq(null, node.getDB("db1").getRole("r2"));
|
||||
var role = node.getDB("db1").getRole("r3");
|
||||
assert.eq(1, role.roles.length, node);
|
||||
assertListContainsRole(role.roles, {role: "r1", db: "db1"}, node);
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
|
||||
function runTest(conn) {
|
||||
var authzErrorCode = 13;
|
||||
var hasAuthzError = function(result) {
|
||||
assert(result.hasWriteError());
|
||||
assert.eq(authzErrorCode, result.getWriteError().code);
|
||||
};
|
||||
|
||||
conn.getDB('admin').createUser({user: 'admin', pwd: 'pwd', roles: ['root']});
|
||||
conn.getDB('admin').auth('admin', 'pwd');
|
||||
@ -49,16 +53,14 @@ function runTest(conn) {
|
||||
var user = testUserAdmin.getUser('spencer');
|
||||
assert.eq(10028, user.customData.zipCode);
|
||||
assert(db.auth('spencer', 'pwd'));
|
||||
db.foo.insert({a:1});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.insert({ a: 1 }));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.doesNotThrow(function() {db.getRole('testRole')});
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
|
||||
db.logout();
|
||||
assert(db.auth('andy', 'pwd'));
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.throws(function() { db.foo.findOne();});
|
||||
assert.throws(function() {db.getRole('testRole')});
|
||||
})();
|
||||
@ -76,8 +78,7 @@ function runTest(conn) {
|
||||
roles: ["read", "testRole"]});
|
||||
var user = testUserAdmin.getUser('spencer');
|
||||
assert.eq(10036, user.customData.zipCode);
|
||||
db.foo.insert({a:1});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.insert({ a: 1 }));
|
||||
assert.eq(1, db.foo.findOne().a);
|
||||
assert.eq(1, db.foo.count());
|
||||
assert.doesNotThrow(function() {db.getRole('testRole')});
|
||||
@ -85,8 +86,7 @@ function runTest(conn) {
|
||||
|
||||
testUserAdmin.updateUser('spencer', {roles: ["readWrite",
|
||||
{role: 'adminRole', db:'admin'}]});
|
||||
db.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.eq(2, db.foo.findOne().a);
|
||||
assert.eq(1, db.foo.count());
|
||||
assert.throws(function() {db.getRole('testRole')});
|
||||
@ -107,8 +107,7 @@ function runTest(conn) {
|
||||
'readWrite']);
|
||||
|
||||
assert.commandWorked(db.runCommand({collMod: 'foo', usePowerOf2Sizes: true}));
|
||||
db.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleSuccess(db);
|
||||
assert.writeOK(db.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.eq(3, db.foo.findOne().a);
|
||||
assert.eq(1, db.foo.count());
|
||||
assert.doesNotThrow(function() {db.getRole('testRole')});
|
||||
@ -124,8 +123,7 @@ function runTest(conn) {
|
||||
"testRole"]);
|
||||
|
||||
assert.commandWorked(db.runCommand({collMod: 'foo', usePowerOf2Sizes: true}));
|
||||
db.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.throws(function() { db.foo.findOne();});
|
||||
assert.throws(function() {db.getRole('testRole')});
|
||||
assert.commandWorked(db.adminCommand('connPoolSync'));
|
||||
@ -133,8 +131,7 @@ function runTest(conn) {
|
||||
|
||||
testUserAdmin.revokeRolesFromUser('spencer', [{role: 'adminRole', db: 'admin'}]);
|
||||
|
||||
db.foo.update({}, {$inc: {a:1}});
|
||||
assert.gleErrorCode(db, authzErrorCode);
|
||||
hasAuthzError(db.foo.update({}, { $inc: { a: 1 }}));
|
||||
assert.throws(function() { db.foo.findOne();});
|
||||
assert.throws(function() {db.getRole('testRole')});
|
||||
assert.commandFailedWithCode(db.adminCommand('connPoolSync'), authzErrorCode);
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
var mydb = db.getSiblingDB('auth1_db');
|
||||
mydb.dropAllUsers();
|
||||
|
||||
pass = "a" + Math.random();
|
||||
//print( "password [" + pass + "]" );
|
||||
|
||||
mydb.createUser({user: "eliot" ,pwd: pass, roles: jsTest.basicUserRoles});
|
||||
|
||||
assert( mydb.auth( "eliot" , pass ) , "auth failed" );
|
||||
assert( ! mydb.auth( "eliot" , pass + "a" ) , "auth should have failed" );
|
||||
|
||||
pass2 = "b" + Math.random();
|
||||
mydb.changeUserPassword("eliot", pass2);
|
||||
|
||||
assert( ! mydb.auth( "eliot" , pass ) , "failed to change password failed" );
|
||||
assert( mydb.auth( "eliot" , pass2 ) , "new password didn't take" );
|
||||
|
||||
assert( mydb.auth( "eliot" , pass2 ) , "what?" );
|
||||
mydb.dropUser( "eliot" );
|
||||
assert( ! mydb.auth( "eliot" , pass2 ) , "didn't drop user" );
|
||||
|
||||
|
||||
var a = mydb.getMongo().getDB( "admin" );
|
||||
a.dropAllUsers();
|
||||
pass = "c" + Math.random();
|
||||
a.createUser({user: "super", pwd: pass, roles: jsTest.adminUserRoles});
|
||||
assert( a.auth( "super" , pass ) , "auth failed" );
|
||||
assert( !a.auth( "super" , pass + "a" ) , "auth should have failed" );
|
||||
|
||||
mydb.dropAllUsers();
|
||||
pass = "a" + Math.random();
|
||||
|
||||
mydb.createUser({user: "eliot" , pwd: pass, roles: jsTest.basicUserRoles});
|
||||
|
||||
assert.commandFailed( mydb.runCommand( { authenticate: 1, user: "eliot", nonce: "foo", key: "bar" } ) );
|
||||
|
||||
// check sanity check SERVER-3003
|
||||
|
||||
var before = a.system.users.count({db: mydb.getName()});
|
||||
|
||||
assert.throws( function(){
|
||||
mydb.createUser({ user: "" , pwd: "abc", roles: jsTest.basicUserRoles});
|
||||
} , null , "C1" )
|
||||
assert.throws( function(){
|
||||
mydb.createUser({ user: "abc" , pwd: "", roles: jsTest.basicUserRoles});
|
||||
} , null , "C2" )
|
||||
|
||||
|
||||
var after = a.system.users.count({db: mydb.getName()});
|
||||
assert( before > 0 , "C3" )
|
||||
assert.eq( before , after , "C4" )
|
||||
|
||||
// Clean up after ourselves so other tests using authentication don't get messed up.
|
||||
mydb.dropAllUsers()
|
||||
@ -1,9 +0,0 @@
|
||||
// just make sure logout doesn't break anything
|
||||
|
||||
// SERVER-724
|
||||
db.runCommand({logout : 1});
|
||||
x = db.runCommand({logout : 1});
|
||||
assert.eq( 1 , x.ok , "A" )
|
||||
|
||||
x = db.logout();
|
||||
assert.eq( 1 , x.ok , "B" )
|
||||
@ -1,19 +0,0 @@
|
||||
a = db.getSisterDB( "copydb2-test-a" );
|
||||
b = db.getSisterDB( "copydb2-test-b" );
|
||||
|
||||
a.dropDatabase();
|
||||
b.dropDatabase();
|
||||
a.dropAllUsers();
|
||||
b.dropAllUsers();
|
||||
|
||||
a.foo.save( { a : 1 } );
|
||||
|
||||
a.createUser({user: "chevy" , pwd: "chase", roles: jsTest.basicUserRoles});
|
||||
|
||||
assert.eq( 1 , a.foo.count() , "A" );
|
||||
assert.eq( 0 , b.foo.count() , "B" );
|
||||
|
||||
// SERVER-727
|
||||
a.copyDatabase( a._name , b._name, "" , "chevy" , "chase" );
|
||||
assert.eq( 1 , a.foo.count() , "C" );
|
||||
assert.eq( 1 , b.foo.count() , "D" );
|
||||
@ -1,11 +0,0 @@
|
||||
f = db.jstests_autoid;
|
||||
f.drop();
|
||||
|
||||
f.save( {z:1} );
|
||||
a = f.findOne( {z:1} );
|
||||
f.update( {z:1}, {z:2} );
|
||||
b = f.findOne( {z:2} );
|
||||
assert.eq( a._id.str, b._id.str );
|
||||
c = f.update( {z:2}, {z:"abcdefgabcdefgabcdefg"} );
|
||||
c = f.findOne( {} );
|
||||
assert.eq( a._id.str, c._id.str );
|
||||
@ -1,11 +0,0 @@
|
||||
// SERVER-5826 ensure you can't build an index with a non-existent plugin
|
||||
t = db.bad_index_plugin;
|
||||
|
||||
assert.eq(t.ensureIndex({good: 1}), undefined);
|
||||
assert.eq(t.getIndexes().length, 2); // good + _id
|
||||
|
||||
err = t.ensureIndex({bad: 'bad'});
|
||||
assert.neq(err, undefined);
|
||||
assert(err.code >= 0);
|
||||
|
||||
assert.eq(t.getIndexes().length, 2); // good + _id (no bad)
|
||||
@ -1,21 +0,0 @@
|
||||
|
||||
t = db.getCollection( "basic1" );
|
||||
t.drop();
|
||||
|
||||
o = { a : 1 };
|
||||
t.save( o );
|
||||
|
||||
assert.eq( 1 , t.findOne().a , "first" );
|
||||
assert( o._id , "now had id" );
|
||||
assert( o._id.str , "id not a real id" );
|
||||
|
||||
o.a = 2;
|
||||
t.save( o );
|
||||
|
||||
assert.eq( 2 , t.findOne().a , "second" );
|
||||
|
||||
assert(t.validate().valid);
|
||||
|
||||
// not a very good test of currentOp, but tests that it at least
|
||||
// is sort of there:
|
||||
assert( db.currentOp().inprog != null );
|
||||
@ -1,16 +0,0 @@
|
||||
|
||||
t = db.getCollection( "basic2" );
|
||||
t.drop();
|
||||
|
||||
o = { n : 2 };
|
||||
t.save( o );
|
||||
|
||||
assert.eq( 1 , t.find().count() );
|
||||
|
||||
assert.eq( 2 , t.find( o._id ).toArray()[0].n );
|
||||
assert.eq( 2 , t.find( o._id , { n : 1 } ).toArray()[0].n );
|
||||
|
||||
t.remove( o._id );
|
||||
assert.eq( 0 , t.find().count() );
|
||||
|
||||
assert(t.validate().valid);
|
||||
@ -1,45 +0,0 @@
|
||||
// Tests that "." cannot be in field names
|
||||
t = db.getCollection( "foo_basic3" );
|
||||
t.drop()
|
||||
|
||||
//more diagnostics on bad save, if exception fails
|
||||
doBadSave = function(param) {
|
||||
print("doing save with " + tojson(param))
|
||||
t.save(param);
|
||||
// Should not get here.
|
||||
printjson(db.getLastErrorObj());
|
||||
}
|
||||
|
||||
//more diagnostics on bad save, if exception fails
|
||||
doBadUpdate = function(query, update) {
|
||||
print("doing update with " + tojson(query) + " " + tojson(update))
|
||||
t.update(query, update);
|
||||
// Should not get here.
|
||||
printjson(db.getLastErrorObj());
|
||||
}
|
||||
|
||||
assert.throws(doBadSave, [{"a.b":5}], ". in names aren't allowed doesn't work");
|
||||
|
||||
assert.throws(doBadSave,
|
||||
[{ "x" : { "a.b" : 5 } }],
|
||||
". in embedded names aren't allowed doesn't work");
|
||||
|
||||
// following tests make sure update keys are checked
|
||||
t.save({"a": 0,"b": 1})
|
||||
|
||||
assert.throws(doBadUpdate, [{a:0}, { "b.b" : 1 }],
|
||||
"must deny '.' in key of update");
|
||||
|
||||
// upsert with embedded doc
|
||||
assert.throws(doBadUpdate, [{a:10}, { c: {"b.b" : 1 }}],
|
||||
"must deny embedded '.' in key of update");
|
||||
|
||||
// if it is a modifier, it should still go through
|
||||
t.update({"a": 0}, {$set: { "c.c": 1}})
|
||||
t.update({"a": 0}, {$inc: { "c.c": 1}})
|
||||
|
||||
// edge cases
|
||||
assert.throws(doBadUpdate, [{a:0}, { "":{"b.b" : 1} }],
|
||||
"must deny '' embedded '.' in key of update");
|
||||
t.update({"a": 0}, {})
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
t = db.getCollection( "basic4" );
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 , b : 1.0 } );
|
||||
|
||||
assert( t.findOne() );
|
||||
assert( t.findOne( { a : 1 } ) );
|
||||
assert( t.findOne( { a : 1.0 } ) );
|
||||
assert( t.findOne( { b : 1 } ) );
|
||||
assert( t.findOne( { b : 1.0 } ) );
|
||||
|
||||
assert( ! t.findOne( { b : 2.0 } ) );
|
||||
@ -1,6 +0,0 @@
|
||||
t = db.getCollection( "basic5" );
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 , b : [ 1 , 2 , 3 ] } );
|
||||
assert.eq( 3 , t.findOne().b.length );
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
|
||||
t = db.basic6;
|
||||
|
||||
t.findOne();
|
||||
t.a.findOne();
|
||||
|
||||
assert.eq( "test.basic6" , t.toString() );
|
||||
assert.eq( "test.basic6.a" , t.a.toString() );
|
||||
@ -1,11 +0,0 @@
|
||||
|
||||
t = db.basic7;
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 } )
|
||||
t.ensureIndex( { a : 1 } );
|
||||
|
||||
assert.eq( t.find().toArray()[0].a , 1 );
|
||||
assert.eq( t.find().arrayAccess(0).a , 1 );
|
||||
assert.eq( t.find()[0].a , 1 );
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
|
||||
t = db.basic8;
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 } );
|
||||
o = t.findOne();
|
||||
o.b = 2;
|
||||
t.save( o );
|
||||
|
||||
assert.eq( 1 , t.find().count() , "A" );
|
||||
assert.eq( 2 , t.findOne().b , "B" );
|
||||
@ -1,19 +0,0 @@
|
||||
// Tests that $<prefix> field names are not allowed, but you can use a $ anywhere else.
|
||||
t = db.getCollection( "foo_basic9" );
|
||||
t.drop()
|
||||
|
||||
// more diagnostics on bad save, if exception fails
|
||||
doBadSave = function(param) {
|
||||
print("doing save with " + tojson(param))
|
||||
t.save(param);
|
||||
// Should not get here.
|
||||
printjson(db.getLastErrorObj());
|
||||
}
|
||||
|
||||
t.save({foo$foo:5});
|
||||
t.save({foo$:5});
|
||||
|
||||
assert.throws(doBadSave, [{$foo:5}], "key names aren't allowed to start with $ doesn't work");
|
||||
assert.throws(doBadSave,
|
||||
[{x:{$foo:5}}],
|
||||
"embedded key names aren't allowed to start with $ doesn't work");
|
||||
@ -1,33 +0,0 @@
|
||||
|
||||
t = db.basica;
|
||||
|
||||
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 , b : [ { x : 2 , y : 2 } , { x : 3 , y : 3 } ] } );
|
||||
|
||||
x = t.findOne();
|
||||
x.b["0"].x = 4;
|
||||
x.b["0"].z = 4;
|
||||
x.b[0].m = 9;
|
||||
x.b[0]["asd"] = 11;
|
||||
x.a = 2;
|
||||
x.z = 11;
|
||||
|
||||
tojson( x );
|
||||
t.save( x );
|
||||
assert.eq( tojson( x ) , tojson( t.findOne() ) , "FIRST" );
|
||||
|
||||
// -----
|
||||
|
||||
t.drop();
|
||||
|
||||
t.save( { a : 1 , b : [ { x : 2 , y : 2 } , { x : 3 , y : 3 } ] } );
|
||||
|
||||
x = t.findOne();
|
||||
x.b["0"].z = 4;
|
||||
|
||||
//printjson( x );
|
||||
t.save( x );
|
||||
assert.eq( tojson( x ) , tojson( t.findOne() ) , "SECOND" );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user