首页 \ 问答 \ 作曲家 - 无法在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 ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)