V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
TangMonk
V2EX  ›  问与答

mongoose 返回的值能不能易读点?

  •  
  •   TangMonk · 2014-07-12 16:28:51 +08:00 · 2963 次点击
    这是一个创建于 3588 天前的主题,其中的信息可能已经有所发展或是发生改变。
    一个 unique 的错误返回这种:

    insertDocument :: caused by :: 11000 E11000 duplicate key error index: miccity_test.users.$username_1 dup key: { : "11112312a" }

    我是负责做 api 的,怎么想移动端解释这么奇葩(难读)的错误,而且没法判断。。
    4 条回复    2014-07-12 17:41:52 +08:00
    zieglar
        1
    zieglar  
       2014-07-12 16:50:00 +08:00
    自己没有在代码里处理 unique 问题,本身就不对吧,如果靠你这样来写 API,那移动端还不如直接对 monogodb 操作,反正它还提供了 RESTful 接口,要你何用呢?
    WildCat
        2
    WildCat  
       2014-07-12 16:52:26 +08:00   ❤️ 1
    TangMonk
        3
    TangMonk  
    OP
       2014-07-12 17:41:43 +08:00
    @zieglar 好吧,今天上火,不好意思
    TangMonk
        4
    TangMonk  
    OP
       2014-07-12 17:41:52 +08:00
    @WildCat 谢谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1985 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:28 · PVG 00:28 · LAX 09:28 · JFK 12:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.