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

作曲家 - 无法在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.

相关问答

更多
  • 为什么我的Distinct()不起作用? 因为Distinct 首先检查哈希码(因为它是一个快速检查以查看两个对象是否相等) 然后调用Equals 。 由于您的GetHashCode实现都是相同的(并且与您的Equals方法不对应),因此Distinct无法正常工作。 将GetHashCode方法更改为与Equals对应: public class NormalizedWordComparer : IEqualityComparer { public bool Equals(Word ...
  • 对于SaveEqual您可以自定义检查IEnumerable类型比较 - 您可以检查xEnumerable中的每个项是否包含在yEnumerable 。 注意1 :你这里也有一个错误 - yEnumerable可以包含其他项目,也可以包含重复项目。 但是对于SaveHashCode您没有IEnumerable类型的自定义处理。 您只需返回参数的哈希码。 即使数组包含相同的值,这也会为不同的数组实例提供不同的结果。 要解决此问题,您应该根据集合项计算哈希代码: public int SaveHashCode< ...
  • 您需要明确提供比较器,此时您不需要: 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 ten ...
  • public IEnumerable GetAllRecords() { var records = _tableName.GetAll() .GroupBy(tb => tb.Date) .Select(g=>g.First()); return records; } 注意 :我们仍然不清楚你想要什么,我们有重复行的Base和ID部分是不同的 ,所以你可能有一些标准或规则在一组Date选择它 ...
  • var result = from eachError in SystemErrors let match = Regex.Match(eachError.Description, "...") group eachError by new { FamilyCode = match.Groups["FamilyCode"].Value, ProductPrefix = ma ...
  • 你可以使用分组,因为它让我畏缩使用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.Propert ...
  • 尝试这个 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(Field ...
  • 我想你可以使用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表达式时遇到问题,则可以调用.ToList()强制将查询实现到内存中以供进一步处理。 如果您从数据库或其他来源获得的结果非常昂贵,并且可以先进一步缩小,则这不太理想。 IEnumerable filteredList = originalList .ToList() .GroupBy(customer => customer.CustomerId) .Select(group => group.First()); .ToList()调用 ...
  • 您可能必须自己加入表: 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=>ii.Ba ...

相关文章

更多

最新问答

更多
  • 在开发React应用程序时编译/转换代码(Compile/transpile code while developing React app)
  • 将MultiPoint序列化为GeoJSON文件(Serialize MultiPoint to GeoJSON file)
  • 将字符串截断为特定数量的字符,忽略HTML(Truncate string to certain amount of characters, ignoring HTML)
  • Sqlserver监视时间的变化(Sqlserver watch for time change)
  • Srcset属性 - 最大宽度问题(Srcset attribute - max-width issue)
  • 如何验证数据库中是否存在记录?(How to verify existence of a record in database?)
  • SQL JOIN来自不同表的行具有相同的值(SQL JOIN row from different table with the same values)
  • NSTextField - 使用KVO进行输入验证?(NSTextField - Input validation with KVO?)
  • 在Javascript中,如何检查数组是否有重复值?(In Javascript, how do I check if an array has duplicate values? [duplicate])
  • 获取过滤器从spark数据帧中删除的行的示例(Get examples for rows that are removed by a filter from a spark dataframe)
  • 如果Shape在屏幕外,是否执行Graphics2D.draw?(Is Graphics2D.draw performed if the Shape is offscreen?)
  • 如果没有头文件,如何定义静态成员?(How to define a static member in case there is not header file?)
  • NSLocalizedStringFromTableInBundle:没有获取key的值(NSLocalizedStringFromTableInBundle : not getting values for key)
  • Google Cloud Messanger,“比预期的更多”(Google Cloud Messanger, “More acks than expected”)
  • HorizontalScrollView不起作用(HorizontalScrollView not working)
  • 关闭所有表单后退出应用程序(Quit Application when all forms is closed)
  • 玉林哪个会计培训学校有周末上课的!
  • java的。(java. Unique identifier for each visitor. How better generated?)
  • 希望大家告诉我学java编程的方法?
  • 在GAS嵌入式环境中通过Javascript刷新HTML文档(Refresh HTML Document via Javascript in a GAS Embedded Environment)
  • 当我在另一个类中调用它时,setText不起作用(setText does not work when I call it in another class)
  • 无法在静态字段中设置变量值(Can't Set variable value in Static Field)
  • IE9布局错误 - 在早期的IE版本中很好(IE9 Layout Bug - fine in earlier IE versions)
  • 按钮命令上的WPF新DataGrid行参数为NULL(WPF New DataGrid Row Parameter NULL on Button Command)
  • Wordpress上的CSS配置(CSS configuration on Wordpress )
  • 关于OpenGL设置的问题以及在窗口中绘制掩码的问题(Questions about OpenGL Settings and drawing over a mask in a window)
  • Matlab编码器fzero功能(Matlab coder fzero function)
  • Autodesk Maya,C ++和OpenGL渲染引擎(Autodesk Maya, C++ and OpenGL rendering engine)
  • 选择记录字段包含另一个字段的最大值(Select field of record contains max of another field)
  • 可选参数在Swashbuckle.AspNetCore中导致null异常(Optional parameter causes null exception in Swashbuckle.AspNetCore)