草庐IT

get_params

全部标签

MongoDb - 聚合 : How to get Grand Totals with Individual, 未分组记录?

假设我们有这样的文档:{type:"hourly",amount:100},{type:"flat",amount:350},{type:"hourly",amount:200},{type:"payment",amount:100},{type:"payment",amount:200}在管道的某处,我想为每个“类型”累积总计。连同所有个人记录,我想知道我们的总计如下:hourly:$300flat:$350payment:$300我查看了$add和$sum,它们似乎对为给定记录添加字段很有用,但对累计总计没有帮助。到目前为止,我的聚合过滤了我想要的所有记录并且没有使用分组。我不想对

python - MongoDB/PyMongo/Python(时间): Getting the Datetime as String

我的文档中有一个具有以下结构的MongoDB数据库:>"_id":{>"mandant":"a4da7117-2763-48df-b3a3-d50a0f6006fe",>"ersteller":"9bc79ce4-c23a-4c24-a857-80f94a341d39",>"sender":"9bc79ce4-c23a-4c24-a857-80f94a341d39",>"vorgang":"c08382ed-143f-46f7-8382-ed143f26f7b8",>"nachricht":"6c9d3386-001f-4809-9d33-86001fd80990">},>"_clas

ASP.Net Core Web API结合Entity Framework Core框架(API的创建使用,接口前端权限设置,前端获取API的Get,post方法)(程序包引用以及导入数据库)

目录1.WebApi程序包引用2.WebApi的创建与Http类型的介绍2.1 ASP.NetCoreWebAPI项目的创建2 .2 API接口的创建2.3 HttpGet和HttpPost类型的区别3.接口权限设置4.HttpGet方法和HttpPOst方法5.前端中用HttpGet/Poset获取接口数据6.EF框架——配置数据库链接字符串(即将数据库中的表导入项目中)7.WebApi和EF结合的增删改查需注意的部分代码 8.当web返回给窗体如下特殊字符串时,在web端的program的main函数中加入以下代码:1.WebApi程序包引用EntityFramework(EF)Core是

mongodb - 在 Docker 启动期间,我收到此消息 : "getting the final child' s pid from pipe caused "read init-p: connection reset by peer"

我在CentOSLinux7.6.1810和PleskOnyx17.8.11下安装了Docker,一切正常。几个小时以来,我无法再启动mongoDB或Docker。我收到此错误消息{"message":"OCIruntimecreatefailed:container_linux.go:344:startingcontainerprocesscaused\"process_linux.go:297:gettingthefinalchild'spidfrompipecaused\\\"readinit-复制代码p:连接由对等方重置\\\“\”:未知“它会是什么?

javascript - 如何修复 Mongoose 模型的 deleteOne() 函数,当它不被 req.params.id 删除时?

首先要提到的是,我对Node.Js和MongoDB完全陌生。我正在使用Node.Js和MongoDB编写后端API,它将处理来自前端的GET、POST、DELETE请求,这些非常简单。我在使用DELETE功能时卡住了。这是我的posts.service.ts文件,其中包含此deletePost()函数,该函数将postId发送到后端app.js文件。`deletePost(postId:string){this.http.delete('http://localhost:3000/api/posts/'+postId).subscribe(()=>{console.log(postId

node.js - 使用对象作为在 router.get 中查找值的键

我正在使用这个Controller来使用我的服务然后调用我的router.get,我想在从mongodb获取请求时使用userObject.blood_component作为searchFinderController:varuserObject={};userObject.blood_component="findme";Bloodstock.getStocks(userObject).then(function(data){});然后调用api路由:服务:bloodstockFactory.getStocks=function(userObject){return$http.get

node.js - 蒙戈/ express : How to return all documents in collection if no query params are passed?

如果没有传递查询参数,我将尝试从我的Mongo集合中返回所有文档。目前我有3个可选的查询参数可以由用户传递。localhost:3000/api/projects//shouldreturnallprojects.Currentlythisisreturning[]localhost:3000/api/projects?id=1//shouldreturnprojectswithidof"1".Workingproperly.localhost:3000/api/projects?name=myproject//shouldreturnprojectswithnameof"myproj

ruby - "NameError: uninitialized constant User::MongoMapper"尝试 MongoMapper 'Getting Started'

这是我的irbsession:irb(main):001:0>classUserirb(main):002:1>includeMongoMapper::Documentirb(main):003:1>key:name,Stringirb(main):004:1>key:age,Integerirb(main):005:1>many:hobbiesirb(main):006:1>endNameError:uninitializedconstantUser::MongoMapperfrom(irb):2irb(main):007:0>在http://mongomapper.com/的右边我

javascript - Mongo 外壳光标 : updated documents get to cursor again

我正在尝试在Mongoshell中遍历游标以更新集合中的所有文档。我的目标是重命名文档中的一些字段,所以代码看起来像这样:varcursor=db.collection.find();while(cursor.hasNext()){vardoc=cursor.next();printjson(doc);db.collection.update({_id:doc._id},{$set:{docId:doc.docID,createdAt:doc.dateAdded,updatedAt:doc.dateAdded},$unset:{dateAdded:"",docID:""}});}代码非

mongodb - 为什么 reactivemongo 的 collection.save() 做一个 get()?

有时我会读到一段由专家编写的代码,这会引发一个大危险信号,因为它显然关注我一无所知的事情——而且可能应该。在这种情况下,这里是reactivemongo的BSONCollection.save()的实现,它根据ObjectId执行更新插入:defsave(doc:BSONDocument,writeConcern:GetLastError)(implicitec:ExecutionContext):Future[LastError]={doc.get("_id").map{id=>update(BSONDocument("_id"->id),doc,writeConcern,upser