Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试基于名称建立搜索。我正在使用新手 mongoid 用户。我想要一个查询,如果我通过“A”,它将返回所有以“A”开头的名称。
做就是了:
User.where(:name => /^A/)