推荐工具
› RoboMongo
推荐书目
› 50 Tips and Tricks for MongoDB Developers
Related Blogs
› Snail in a Turtleneck
WildCat
V2EX  ›  MongoDB

Mongoose/MongoDB 如何做不区分大小写的唯一索引?

  •  
  •   WildCat · Jun 24, 2014 · 7100 views
    This topic created in 4478 days ago, the information mentioned may be changed or developed.
    类似MySQL的 utf8_general_ci
    2 replies  •  2014-06-24 14:51:34 +08:00
    GordianZ
        1
    GordianZ  
       Jun 24, 2014   ❤️ 1
    我的方法:另外加一个 field 对其索引,然后建 save / update 的 middleware, 对字符串统一大小写。
    jiangzhuo
        2
    jiangzhuo  
       Jun 24, 2014
    @GordianZ 樓上大正解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   862 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 100ms · UTC 18:56 · PVG 02:56 · LAX 11:56 · JFK 14:56
    ♥ Do have faith in what you're doing.