Ⅰ. 插件描述
A Vim plugin for viewing MongoDB dataⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'robu3/vimongous'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'robu3/vimongous'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'robu3/vimongous'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/robu3/vimongous
Ⅳ. 文档说明
# Vimongous
Query your MongoDB data inside Vim
Vimongous is a Vim plugin for querying a MongoDB database from inside Vim. It relies on Venode for query execution.
Why?
- MongoDB lacks a decent multi-line query tool with the ability have multiple query windows open (think SQL Server Management Studio)
- Vim rocks and therefore constructing queries with it also rocks
Usage
Vimongous relies on a C #pragma-like syntax for setting the DSN for queries run in the current buffer.
After setting the //#dsn pragma, use Visual Mode to select the chunk of query text you want to run, and use <leader>mq (_M_ongo _Q_uery) to execute it.
I may potentially add additional options using the same syntax in the future (or feel free to add your own!).
Example
See the example query buffer below:
//#dsn mongodb://localhost/products
db.widgets.find({
Name: /Widget/
})
.sort({
Cdate: -1
})