我尝试使用mongoose更新文档,但它失败了.我可以直接在Mongo中成功执行的查询如下:
db.orders.update(
{
orderId: 1014428,
'delivery.items.id': '5585d77c714a90fe0fc2fcb4'
},
{
$inc: {
"delivery.items.$.quantity" : 1
}
}
)
Run Code Online (Sandbox Code Playgroud)
当我尝试使用mongoose运行以下更新命令时:
this.update(
{
orderId: this.orderId ,
"delivery.items.id": product.id
},
{
$inc: {
"delivery.items.$.quantity" : 1
}
}, function (err, raw) {
if (err) {
console.log(err);
}
console.log('The raw response from Mongo was ', raw);
}
);
Run Code Online (Sandbox Code Playgroud)
我看到以下错误:
{ [MongoError: cannot use the part (items of delivery.items.id) to traverse the element ({items: [ { quantity: 1, price: 6.9, name: "Manipulationstechniken", brand: null, id: "5585d77c714a90fe0fc2fcb4" …Run Code Online (Sandbox Code Playgroud) 我使用Parsedown将 Markdown 转换为 HTML,如下所示:
$pd->text('# My First heading');
Run Code Online (Sandbox Code Playgroud)
如果想要自动使用第一个站点标题 (h1) 作为自定义菜单的条目。我已经查看了源代码,但无法找到获取所有标题的好方法。
也许有一些功能在elements起作用。有谁有想法获得全部或至少第一个标题。
我使用不同的构建脚本来打包我的应用程序。他们中的一些人运行了一段时间,如果视觉通知已准备好脚本,那就太好了。
我已经将通知中心与Apple Script一起使用,但是它不足以使您感到震惊。是否可以运行Applescript或命令行命令以使屏幕闪烁。加号会以不同的颜色闪烁(绿色表示正常,红色表示生成失败)。