MongoDB使用命令行上传图片文件
来源:互联网 发布:海颐软件 编辑:程序博客网 时间:2024/05/19 12:18
在mongoDB环境变量配置好的前提下,使用mongodb的命令行上传一张图片。(Linux环境下)
mongofiles put --host 10.0.60.44 --port 27017 --db scity --local ~/IMG_20141129_114338.jpg photo.jpg --type jpg
其中:
--host 是mongodb的ip;--port 是端口号--db 是数据库的名称--local 要填2个参数,第一个是本地图片的路径,第二个是在数据库中的别名。--type 是保存的格式。
-help的输出如下:
Browse and modify a GridFS filesystem.usage: mongofiles [options] command [gridfs filename]command: one of (list|search|put|get) list - list all files. 'gridfs filename' is an optional prefix which listed filenames must begin with. search - search all files. 'gridfs filename' is a substring which listed filenames must contain. put - add a file with filename 'gridfs filename' get - get a file with filename 'gridfs filename' delete - delete all files with filename 'gridfs filename'Options: --help produce help message -v [ --verbose ] be more verbose (include multiple times for more verbosity e.g. -vvvvv) --quiet silence all non error diagnostic messages --version print the program's version and exit -h [ --host ] arg mongo host to connect to ( <set name>/s1,s2 for sets) --port arg server port. Can also use --host hostname:port --ipv6 enable IPv6 support (disabled by default) -u [ --username ] arg username -p [ --password ] arg password --authenticationDatabase arg user source (defaults to dbname) --authenticationMechanism arg (=MONGODB-CR) authentication mechanism --gssapiServiceName arg (=mongodb) Service name to use when authenticating using GSSAPI/Kerberos --gssapiHostName arg Remote host name to use for purpose of GSSAPI/Kerberos authentication --dbpath arg directly access mongod database files in the given path, instead of connecting to a mongod server - needs to lock the data directory, so cannot be used if a mongod is currently accessing the same path --directoryperdb each db is in a separate directory (relevant only if dbpath specified) --journal enable journaling (relevant only if dbpath specified) -d [ --db ] arg database to use -c [ --collection ] arg collection to use (some commands) -l [ --local ] arg local filename for put|get (default is to use the same name as 'gridfs filename') -t [ --type ] arg MIME type for put (default is to omit) -r [ --replace ] Remove other files with same name after PUT
0 0
- MongoDB使用命令行上传图片文件
- windows下MongoDB使用命令行上传图片
- 使用mongodb gridfs上传图片
- 使用终端命令行上传文件到SVN
- 使用MultipartEntity上传图片文件
- Mongodb 上传图片
- ftp命令行上传文件
- java使用FtpClient上传图片文件
- php使用AjaxFileUpload上传图片文件实例
- iOS使用AFNetworking上传图片或者文件
- android使用webview上传文件(图片)
- WebUploader文件图片上传插件的使用
- iOS使用AFNetworking上传图片或者文件
- 使用uedito文件编辑器上传图片问题
- 如何使用nodejs上传图片/文件
- 使用node上传文件或者数据到mongodb
- MongoDB篇——Java Maven项目中使用MongoDB GridFS上传音频图片
- yii上传图片、yii上传文件、yii控件activeFileField使用
- zoj 1151 Word Reversal
- UIWebView的使用
- 个人代码中常用的宏定义
- nagios安装
- 第19周上机实践项目1——动态链表体验(3)
- MongoDB使用命令行上传图片文件
- Linux下OpenSSL 安装图文详解
- UIWebView的用法
- 程序员解决问题的60个策略
- 松岗沙浦网站免费推广培训_近些年网络营销人才的稀缺涌现大量的高薪就业机会,来月亮湾培训学校让你不在为工作烦恼
- iOS开发笔记--iphone开发震动与播放声音Demo
- 程序员应该投资的10件事
- Python os模块
- Flatten Binary Tree to Linked List