小编use*_*240的帖子

如何剪切svg的白色部分?

我有一个脚本,可以生成 SVG 图像文件和 SVG 文件中心的其他内容。围绕这些图像 - 白色背景。如何修剪背景?\nSVG 中的图像大小可能不同。

\n\n

示例 \xe2\x80\x94 我想从 svg 中删除白色区域并仅留下蓝色图像。

\n\n

在此输入图像描述

\n

html php jquery svg

4
推荐指数
1
解决办法
3万
查看次数

如何使用来自其他模型的数据过滤 Mongoose 模型中的文档

例如,我有 3 个模型:

故事:

{
    title: { type: String },
    text: { type: String }
}
Run Code Online (Sandbox Code Playgroud)

注释:

{
    text: { type: String },
    story: { type: mongoose.Schema.Types.ObjectId, ref: "Stories" }
}
Run Code Online (Sandbox Code Playgroud)

喜欢:

{
    story: { type: mongoose.Schema.Types.ObjectId, ref: "Stories" }
}
Run Code Online (Sandbox Code Playgroud)

如果受欢迎程度取决于评论和喜欢的数量,我如何获得最受欢迎的故事?例如,如果故事有更多的评论和喜欢,它就会更受欢迎。

谢谢。

更新:示例数据。

Stories: 
{
  "title": "First story",
  "text": "This must be the MOST popular story..."
}

{
  "title": "Second story",
  "text": "This story is popular too, but not as the first story."
}

{
  "title": "Third story",
  "text": …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js

2
推荐指数
1
解决办法
1419
查看次数

标签 统计

html ×1

jquery ×1

mongodb ×1

mongoose ×1

node.js ×1

php ×1

svg ×1