作曲家 - 无法在Windows上安装mongodb / mongodb(Composer - Unable to install mongodb/mongodb on Windows)

我试图在使用composer的Laravel安装中安装以下软件包: jenssegers/mongodb

但是当安装时,我收到以下错误:

- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].

当我运行composer show -p时,扩展名实际上是这样列出的:

ext-mongo           1.6.12   The mongo PHP extension

当我执行php_info()或其他任何操作时,它也会正确启用。

我也确定我在正确的php.ini文件中启用了它。

其实,我想这个问题来自于它应该被称为mongodb而不是mongo

他们是否有任何针对Windows的解决方案?

谢谢。


I'm trying to install the following package on my Laravel installation using composer : jenssegers/mongodb

But when installing, I'm getting the following error :

- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].

The extension is actually listed when I run composer show -p like that :

ext-mongo           1.6.12   The mongo PHP extension

and it's also enabled correctly when I do php_info() or anything.

I'm also sure that I enabled it in the correct php.ini file.

Actually, I guess that the problem comes from the fact that it should be called mongodb instead of mongo.

Is their any fix for this for Windows ?

Thanks.


原文:https://stackoverflow.com/questions/35994943
2022-08-22 16:08

满意答案

您需要明确提供比较器,此时您不需要:

var tenantsList = (from t in db.Tenants
                   select t)
    .Distinct(new TenantComparer())
    .OrderBy( x => x.Name )
    .ToList();

请参阅文档


You need to provide comparer explicitly, which at the moment you do not:

var tenantsList = (from t in db.Tenants
                   select t)
    .Distinct(new TenantComparer())
    .OrderBy( x => x.Name )
    .ToList();

See the documentation.

相关问答

更多

LINQ区别不使用IEqualityComparer?(LINQ Distinct not using the IEqualityComparer? [duplicate])

为什么我的Distinct()不起作用? 因为Distinct 首先检查哈希码(因为它是一个快速检查以查看两个对象是否相等) 然后调用Equals 。 由于您的GetHashCode实现都是相同的(并且与您的Equals方法不对应),因此Distinct无法正常工作。 将GetHashCode方法更改为与Equals对应: public class NormalizedWordComparer : IEqualityComparer<Word> { public bool Equals(...

LINQ.Distinct IEquatable对象不起作用(LINQ.Distinct on IEquatable object doesn't work)

对于SaveEqual您可以自定义检查IEnumerable类型比较 - 您可以检查xEnumerable中的每个项是否包含在yEnumerable 。 注意1 :你这里也有一个错误 - yEnumerable可以包含其他项目,也可以包含重复项目。 但是对于SaveHashCode您没有IEnumerable类型的自定义处理。 您只需返回参数的哈希码。 即使数组包含相同的值,这也会为不同的数组实例提供不同的结果。 要解决此问题,您应该根据集合项计算哈希代码: public int SaveHash...

为什么LINQ中的区别对于这种情况不起作用?(Why distinct in LINQ does not work for this case?)

您需要明确提供比较器,此时您不需要: var tenantsList = (from t in db.Tenants select t) .Distinct(new TenantComparer()) .OrderBy( x => x.Name ) .ToList(); 请参阅文档 。 You need to provide comparer explicitly, which at the moment you do not: va...

使用Linq的不同行(Distinct rows using Linq)

public IEnumerable<tableName> GetAllRecords() { var records = _tableName.GetAll() .GroupBy(tb => tb.Date) .Select(g=>g.First()); return records; } 注意 :我们仍然不清楚你想要什么,我们有重复行的Base和ID部分是不同的 ,所以你可能有一些标准或规则在一组Da...

Linq明显无法正常工作(Linq distinct not working correctly)

var result = from eachError in SystemErrors let match = Regex.Match(eachError.Description, "...") group eachError by new { FamilyCode = match.Groups["FamilyCode"].Value, ProductPrefix...

Linq选择由两个属性Distinct(Linq select Distinct by two properties)

你可以使用分组,因为它让我畏缩使用groupBy做一个独特的。 您可以在IGrouping上调用First来从组中获取一个项目,这实际上是一个独特的。 它看起来像这样: var distinctItems = data.GroupBy(item => new{ //include all of the properties that you want to //affect the distinct-ness of the query item.Property1 item.Pr...

MySQL COUNT(CASE WHEN ... THEN DISTINCT列)(MySQL COUNT(CASE WHEN … THEN DISTINCT Column))

尝试这个 COUNT(DISTINCT( CASE WHEN YEAR(FieldValue) = YEAR(CURDATE()) AND MONTH(FieldValue) = MONTH(CURDATE()) THEN ColumnID END ) ) AS mtd Try this COUNT(DISTINCT( CASE WHEN YEAR(FieldValue) = YEAR(CURDATE()) AND MONTH(...

Linq to SQL order by Distinct(Linq to SQL order by with Distinct)

我想你可以使用GroupBy做你想做的事。 var Top5MFG = db.orders .Where (x => x.manufacturer.Length > 0 && x.customerid == "blahblahblahblahblah") .GroupBy(mfg => mfg.manufacturer) .Select(g => g.First()) .OrderByDescending(d => d.date_created ); ...

选择与Linq to Entities不同(Select Distinct with Linq to Entities)

如果您在通过实体框架等方式评估LINQ表达式时遇到问题,则可以调用.ToList()强制将查询实现到内存中以供进一步处理。 如果您从数据库或其他来源获得的结果非常昂贵,并且可以先进一步缩小,则这不太理想。 IEnumerable<Customer> filteredList = originalList .ToList() .GroupBy(customer => customer.CustomerId) .Select(group => group.First()); .ToLis...

区别使用条件Linq(Distinct Using Condition Linq)

您可能必须自己加入表: from i in Items where i.Category.ServiceProviderID == 2 && !Items.Any(ii=>ii.BaseItemID == i.ID) 你应该做一个join ,这应该是更好的性能。 You might have to join the table on itself: from i in Items where i.Category.ServiceProviderID == 2 && !Items.Any(ii=>...

相关文章

更多

windows系统安装MongoDB

安装 下载MongoDB的安装包:mongodb-win32-x86_64-2008plus-ssl- ...

MongoDB学习(一):MongoDB 环境的搭建

安装mongodb一般指构建核心的数据服务器mongodb。mongodb 可以作为单个服务器 、主从 ...

solr mongoDB 对比

1 solr 字段是写死的 2 solr优势是大块文本模糊查询,mongoDB还支持正则查询以及类似j ...

MongoDB的安装与使用_深入浅出MongoDB(二)

下载MongoDB安装包,上传与解压,创建数据库和日志存放目录,启动MongoDB,查看MongoDB ...

基于linux安装MongoDB

mongodb-linux-x86_64-rhel62-3.2.3.tgz [ hadoop ...

深入浅出MongoDB(一):认识MongoDB

MongoDB简介:面向集合(Collenction-Orented),模式自由(schema-fre ...

MongoDB学习(三):MongoDB Shell的使用

MongoDB自带简洁但功能强大的JavaScript shell。JavaScript shell键 ...

MongoDB: The Definitive Guide

How does MongoDB help you manage a huMONGOus amount ...

MongoDB之Hadoop驱动介绍

1. 一些概念 Hadoop是一套Apache开源的分布式计算框架,其中包括了分布式文件系统 ...

Mongodb与spring集成(1)------配置

这里我们用到的是spring-data中一个集成mongodb的项目,首先在maven中添加对它的依赖 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本