MongoDB: Conectando via Cliente: Difference between revisions

From Wiki
(Criou página com: '= Conectando via Cliente = '''$ mongo''' <nowiki>MongoDB shell version: 2.6.9 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". F...')
 
 
Line 14: Line 14:
  > '''help'''
  > '''help'''
   
   
  <nowiki>db.help()                    help on db methods
  <nowiki>
db.mycoll.help()            help on collection methods
db.help()                    help on db methods
sh.help()                    sharding helpers
db.mycoll.help()            help on collection methods
rs.help()                    replica set helpers
sh.help()                    sharding helpers
help admin                  administrative help
rs.help()                    replica set helpers
help connect                connecting to a db help
help admin                  administrative help
help keys                    key shortcuts
help connect                connecting to a db help
help misc                    misc things to know
help keys                    key shortcuts
help mr                      mapreduce
help misc                    misc things to know
 
help mr                      mapreduce
show dbs                    show database names
show collections            show collections in current database
show dbs                    show database names
show users                  show users in current database
show collections            show collections in current database
show profile                show most recent system.profile entries with time >= 1ms
show users                  show users in current database
show logs                    show the accessible logger names
show profile                show most recent system.profile entries with time >= 1ms
show log [name]              prints out the last segment of log in memory, 'global' is default
show logs                    show the accessible logger names
use <db_name>                set current database
show log [name]              prints out the last segment of log in memory, 'global' is default
db.foo.find()                list objects in collection foo
use <db_name>                set current database
db.foo.find( { a : 1 } )    list objects in foo where a == 1
db.foo.find()                list objects in collection foo
it                          result of the last line evaluated; use to further iterate
db.foo.find( { a : 1 } )    list objects in foo where a == 1
DBQuery.shellBatchSize = x  set default number of items to display on shell
it                          result of the last line evaluated; use to further iterate
exit</nowiki>
DBQuery.shellBatchSize = x  set default number of items to display on shell
exit
</nowiki>


Saindo
Saindo

Latest revision as of 16:22, 12 September 2016

Conectando via Cliente

$ mongo

MongoDB shell version: 2.6.9
 connecting to: test
 Welcome to the MongoDB shell.
 For interactive help, type "help".
 For more comprehensive documentation, see http://docs.mongodb.org/
 Questions? Try the support group http://groups.google.com/group/mongodb-user

Ajuda:

> help


 db.help()                    help on db methods
 db.mycoll.help()             help on collection methods
 sh.help()                    sharding helpers
 rs.help()                    replica set helpers
 help admin                   administrative help
 help connect                 connecting to a db help
 help keys                    key shortcuts
 help misc                    misc things to know
 help mr                      mapreduce
 
 show dbs                     show database names
 show collections             show collections in current database
 show users                   show users in current database
 show profile                 show most recent system.profile entries with time >= 1ms
 show logs                    show the accessible logger names
 show log [name]              prints out the last segment of log in memory, 'global' is default
 use <db_name>                set current database
 db.foo.find()                list objects in collection foo
 db.foo.find( { a : 1 } )     list objects in foo where a == 1
 it                           result of the last line evaluated; use to further iterate
 DBQuery.shellBatchSize = x   set default number of items to display on shell
 exit
 

Saindo

> exit

Ver também