Meteor JS:如何在Mongo中只显示具有特定单词的数据

Meteor JS: How to display only data that have certain words in Mongo?

本文关键字:单词 数据 显示 JS Mongo Meteor      更新时间:2023-09-26

例如

Posts = new Mongo.Collection('posts');

我在我的帖子中插入了一些这样的数据

Posts.insert({
   tags: ["444","555"]
});

Posts.insert({
   tags: ["111","222"]
});

Posts.insert({
   tags: ["111","333"]
});

现在我想显示 post 标签数字111 (String)。

问题:怎么这么做?

Post.find({
  tags: "111"
});

我相信这应该没问题。