草庐IT

Interface1

全部标签

mongodb - 如何在不覆盖接口(interface)中带注释的@Query 方法的情况下自定义 MongoRepository?

我想通过添加一个方法来自定义MongoRepository,并且仍然使用MongoRepository提供的已实现方法。下面是代码:publicinterfaceTopoRepositoryInterfaceextendsMongoRepository{@Query("{'name':?0}")publicTopofindByName(Stringname);publiclonggetPublishedTopoCount();}实现声明是:publicclassTopoRepositoryImplextendsSimpleMongoRepositoryimplementsTopoRep

java - 将 twitter4J 状态保存到 MongoDB 会得到 "twitter4j.Status is an interface, and JAXB can' t 句柄接口(interface)”

试图保存List到MongoDB(通过Morphia),我得到了这个编译时错误:com.sun.xml.ws.spi.db.DatabindingException:com.sun.xml.bind.v2.runtime.IllegalAnnotationsException:1countsofIllegalAnnotationExceptionstwitter4j.Statusisaninterface,andJAXBcan'thandleinterfaces.thisproblemisrelatedtothefollowinglocation:attwitter4j.Statusa

javascript - Nestjs MongoDb 模式/接口(interface)信息复制

我一直在关注instructions用于将MongoDb与Nestjs一起使用。我已经开始工作了,但是在我看来,信息的重复是相当不必要的(不是DRY)。具体来说,我们似乎需要制作Db模式以及与模式匹配的接口(interface)。在我自己的代码中,它看起来像这样:import{Document,Schema}from'mongoose';exportinterfaceIBlogPostextendsDocument{subject:string;body:string;authorId:string;}exportconstBlogPostSchema=newSchema({subje

javascript - 通过 RESTful JSON 接口(interface)为 MongoDB 创建 API 的最快方法是什么?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭9年前。Improvethisquestion我的技术专长仅限于Javascript和Python。如何为我的客户端JavascriptMVC框架使用MongoDb创建API?

mongodb - Laravel 5.2 + MongoDB + Auth = 用户必须实现 CanResetPassword 接口(interface)

我在Laravel5.2jenssegers/laravel-mongodb上使用make:auth安装了身份验证。注册、登录正常。导致错误的唯一功能是重置密码:UnexpectedValueExceptioninPasswordBroker.phpline238:UsermustimplementCanResetPasswordinterface.inPasswordBroker.phpline238atPasswordBroker->getUser(array('email'=>'xxx@xxx.xxx'))inPasswordBroker.phpline82atPasswordB

java - Mongo Java 驱动程序找不到接口(interface)的公共(public)构造函数

我正在使用https://mongodb.github.io/mongo-java-driver-reactivestreams/1.11/.它似乎在使用https://mongodb.github.io/mongo-java-driver/3.10/.我还有很多其他注册类(class)运行良好。我正在使用https://mongodb.github.io/mongo-java-driver/3.5/bson/pojos/上的建议(和SaveListofinterfaceobjectsusingmongodriverforjava)用于处理具有接口(interface)的字段。但是,我

json - 使用 JSON/HTTP/REST 接口(interface)查询 MongoDB

我正在构建一个ASP.Net网络应用程序并希望从MongoDB(远程托管)访问数据。我的任何文档都像这样(已确保在Utc字段上建立索引);{"_id":{"$oid":"509501393e8785025c10bc21"},"Index":1,"Url":"http:...","CameraId":123,"Utc":{"$date":1351955858006}}考虑到用户端的性能,我想以最快的速度获取这些数据。我尝试过的一个选项是在Page.aspx上通过JSON调用本地Web服务,它使用MongoDBC#驱动程序来查询两个日期(Utc)之间的文档。这行得通,但似乎使用Web服务会

spring - bean 实例化失败 : Specified class is an interface

我在创建用于依赖项注入(inject)的bean时遇到问题。这是场景。我正在处理MongoDB存储库,我还创建了一个使用它的类。我正在尝试实例化两者的bean实例。MongoDB存储库:@RepositorypublicinterfaceProductGlobalTrendRepositoryextendsMongoRepository{publicProductGlobalTrendfindByPid(@Param("pId")StringpId);}正在使用它的类:@Service@Scope("singleton")publicclassProductTrendService{@

c# - 无法使用接口(interface)确定 i => i.Id 的序列化信息

首先,我知道已经有关于此错误消息的问题,但我还没有发现任何与在此类查询中使用接口(interface)相关的问题。我目前正在尝试使用C#Driver2.0更新MongoDB实体。但是,当它尝试构建查询时出现错误(我假设它是Builders.Filter.Eq(i=>i.Id,entity.Id)代码位)并且出现以下错误:Unabletodeterminetheserializationinformationfori=>i.Id.我正在尝试更新以下课​​程publicinterfaceIEntity{stringId{get;set;}}publicinterfaceITrack:IEn

c# - 如何使用 c# 在 mongo DB 驱动程序 2.0 版中使用 IMongoDatabase 接口(interface)实现 "FindOne"和 "EnsureIndex"?

当我使用FindOne时,它​​说“'MongoClientExtensions.GetServer(MongoClient)'isobsolete:'UsethenewAPIinstead.'Observer.Client”作为警告。这是我的代码collection.EnsureIndex(IndexKeys.Ascending("Username","Type"),IndexOptions.SetUnique(true));varuserlog=collection.FindOne(Query.Where(ul=>ul.Username==username&&ul.Type==ty