Abd*_*yan 1 import json couchbase
我开始学习沙发基础。一切都很顺利。我正在遵循 couchbase 官方网站的分步指南。在某一时刻,这个分步教程建议我使用命令提示符运行。在这里,我复制了确切的指南:
\n\n 1.Open a Command (Terminal) window, and navigate to the Couchbase \xe2\x80\x8bbin\n\xe2\x80\x8b folder. \n\nMac OSX /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/ Windows C:\\Program Files\\Couchbase\\Server\\bin\\ Linux /opt/couchbase/bin/ \n\n11.Add this folder to your operating system PATH statement, so that its commands may be invoked from any location. If needed, see your operating system documentation for specific details on this process. 12.In the Terminal, navigate to the \xe2\x80\x8b/CB121\n\xe2\x80\x8b folder on your desktop, which contains the products-data.json \n\xe2\x80\x8b file and \xe2\x80\x8borders-data.json\n\xe2\x80\x8b file. \n\n\n\n\n13.Use the \xe2\x80\x8bcbimport \n\xe2\x80\x8b tool to load the JSON documents in \xe2\x80\x8bproducts-data.json\n\xe2\x80\x8b to the WineSearch\n\xe2\x80\x8b bucket (bucket names are case sensitive). To ensure uniqueness, assign an incrementing integer (\xe2\x80\x8b#MONO_INCR#\n\xe2\x80\x8b ) value to each record as part of its document key, prefixed by its \xe2\x80\x8btype\n\xe2\x80\x8b and \xe2\x80\x8bvariety\n\xe2\x80\x8b , using "\xe2\x80\x8b::\n\xe2\x80\x8b " as a separator. \n \xe2\x9d\x8f Cluster (-c): couchbase://127.0.0.1 \xe2\x9d\x8f Username (-u): WineSearcher \xe2\x9d\x8f Password (-p): password \xe2\x9d\x8f Bucket (-b): WineSearch \xe2\x9d\x8f Format (-f): lines \xe2\x9d\x8f Dataset (-d): file://products-data.json \xe2\x9d\x8f Threads (-t): 4 \xe2\x9d\x8f Key Pattern to Generate (-g): %type%::%variety%::#MONO_INCR# \n\n\n cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# \n\n\n\nNote, code statements in this document can be copied and pasted to your tool. \nRun Code Online (Sandbox Code Playgroud)\n\n当我运行此命令时cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# ,我收到以下错误:
\'cbimport\' is not recognized as an internal or external command, operable program or batch file.\nRun Code Online (Sandbox Code Playgroud)\n\n在我看来,我可能需要安装任何工具,例如 cbimport。我用谷歌搜索了几个小时。没有这样的工具。我感觉自己像个傻子。任何帮助表示赞赏。
\n\n\n您的文件不在路径中。这应该解决它(或添加.exe在之后添加cbimport)
"C:\Program Files\Couchbase\Server\bin\cbimport" json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR#
Run Code Online (Sandbox Code Playgroud)
笔记!!现在您必须确保设置 JSON 文件的正确路径。
但是,您希望使其尽可能短,因此添加C:\Program Files\Couchbase\Server\bin通过以下方式添加路径变量:
控制面板->系统->环境变量
找到`PATH并添加
;C:\Program Files\Couchbase\Server\bin
在路径的末尾,然后保存并退出。
重要的是,现在您需要关闭cmd.exe窗口并重新打开,否则它仍然会读取旧环境。
| 归档时间: |
|
| 查看次数: |
2276 次 |
| 最近记录: |