草庐IT

exist-db

全部标签

python - 将 db.find().map 与 pymongo 一起使用

我正在使用pymongo将一个用服务器端javascript编写的程序移植到python。javscript程序使用这种语法:db.dbname.find(pattern1,pattern2).map(function(i){functionname(i)})Pattern1和pattern2是有效的mongodb查询模式。Functionname是一个有效的javascript函数。所有这些都在javascript源文件中定义。我搜索了文档,但似乎找不到pymongofind().map函数(与map_reduce相反。)这将如何用python重写? 最佳

node.js - node.js 原生 mongodb 驱动程序在运行 db.command({aggregate : . ..}) 时返回 "not master"错误

mongoShell和node.js应用的结果不同。我的mongodb环境使用的是分片集群。TheresultofmongoShellmongos>db.runCommand({aggregate:"collection",pipeline:my_pipeline(),allowDiskUse:true});{"result":[],"ok":1,"$gleStats":{"lastOpTime":Timestamp(1428399959,408),"electionId":ObjectId("552363d7ddfce783509094e5")}}Theresultofnode.js

mongodb - 在本地主机上执行 mongorestore 时出现 "An existing connection was forcibly closed by the remote host"

我有什么:在本地主机(Windows7Pro)上运行的Mongodb3.0.2本地.bson文件(~60GB)32GB内存我的工作:C:\ProgramFiles\MongoDB\Server\3.0\bin>mongorestore--collectioncollection_name--dbdb_nameF:\path_to_bson\archive.bson结果:完成30%时内存利用率为100%很多这样的错误:“错误:WSARecvtcp127.0.0.1:49587:现有连接被远程主机强行关闭。”完成~60%时出现结果并未恢复所有文档。如果我使用另一个存档来恢复(较小,~6GB

node.js - TypeError : db. 集合不是函数,无法获取

我正在尝试从apiRoutes.get('/resources/productinfo/:name')获取一些数据,但出现此错误,我不知道出了什么问题...还有apiRoutes.get('/book/:title')似乎不起作用!我不知道我做错了什么更新:>TypeError:Cannotreadproperty'findOne'ofundefined  atObject.module.exports.findBookByTitle>(/home/themis/firstapp/api/config/database.js:22:26) 

mongodb - 如何使用 Mongo API 从 Cosmos DB 获取集合名称

我正在尝试执行MongoAPI以在AzureCosmos-DB上执行CRUD操作。我正在Azure数据资源管理器上运行查询。这是我正在执行的查询{db.getCollectionNames()}我正面临{"code":500,"body":"{\"message\":\"处理您的请求时出错。请稍后重试。\",\"httpStatusCode\":\"InternalServerError\",\"xMsServerRequestId\":null,\"stackTrace\":null}"}如果我在这里做错了,您能否提出更改建议。 最佳答案

node.js - Node js 和 mongoDB - TypeError : db. 集合不是函数

我正在尝试将数据从POSTMAN发布到我在mLab上创建的外部数据库,但我收到错误db.collectionisnotafunction。有一个类似的问题线程,但答案不完整,并且没有将我放入postman的任何键/值保存到mLab。我尝试使用的代码来自本教程:https://medium.freecodecamp.com/building-a-simple-node-js-api-in-under-30-minutes-a07ea9e390d2我的代码:服务器.jsconstexpress=require('express');//LoadroutesapplicationconstM

json - 如何导入 sails.js disk.db 到 mongodb

所以我有一个使用sailsjs的nodejs应用程序网络框架。在开发过程中,我将适配器设置为sails-disk。disk.db中的示例数据类似于{"data":{"authentication":[{"user_id":1,"username":"user1","encrypted_password":"passwordhere","createdAt":"2014-05-12T07:40:24.901Z","updatedAt":"2014-08-18T19:37:22.851Z","id":1,"email":"user1@email.com"}],"user":[{"name"

javascript - 将mongo db连接到远程服务器nodejs

我使用nodejs服务器并使用mongoose在本地连接到MongoDB:mongooseQ.connect("mongodb://localhost:27017/YepiMobile");如何从我的机器连接到位于远程服务器上的mongo数据库?类似于:mongooseQ.connect("mongodb://remote.server.com:27017/YepiMobile"); 最佳答案 第二次连接尝试是否失败,通过阅读Mongoose的文档似乎您已经正确完成了:mongoose.connect('mongodb://user

Git报错Updates were rejected because the tag already exists in the remote.解决方案

情景    在使用git推送的时候,不知道是什么原因导致报错了,内容为:Updateswererejectedbecausethetagalreadyexistsintheremote.这里有两种解决方案,有种能彻底解决问题。No.1:Pushalltags推送的时候,将这个选项取消 这是使用SourceTree视图进行推送的,如果是命令端,就不要使用--tagsNo.2:将本地的Tags先删除(谨慎操作可先备份,再删除),然后再Pull拉一下,再Push就OK了,彻底解决问题 文件路径在项目所在路径【.git/refs/tags】。

LLaMA加载时遇见:ValueError: Tokenizer class LLaMATokenizer does not exist or is not currently imported.

在加载LLaMA模型时遇到到的问题及解决方法。1.问题1解决方法:找到llama模型中的tokenizer_config.json文件,把“tokenizer_class”对应的“LLaMATokenizer”改为“LlamaTokenizer”。2.问题2在解决问题1后,继续运行可能会遇到下面的问题:解决方法:!pipinstalltransformers[sentencepiece]