TangMonk
V2EX  ›  问与答

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

  •  
  •   TangMonk · Jul 12, 2014 · 3406 views
    This topic created in 4326 days ago, the information mentioned may be changed or developed.
    一个 unique 的错误返回这种:

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

    我是负责做 api 的,怎么想移动端解释这么奇葩(难读)的错误,而且没法判断。。
    4 replies    2014-07-12 17:41:52 +08:00
    zieglar
        1
    zieglar  
       Jul 12, 2014
    自己没有在代码里处理 unique 问题,本身就不对吧,如果靠你这样来写 API,那移动端还不如直接对 monogodb 操作,反正它还提供了 RESTful 接口,要你何用呢?
    TangMonk
        3
    TangMonk  
    OP
       Jul 12, 2014
    @zieglar 好吧,今天上火,不好意思
    TangMonk
        4
    TangMonk  
    OP
       Jul 12, 2014
    @WildCat 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2452 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 16:11 · PVG 00:11 · LAX 09:11 · JFK 12:11
    ♥ Do have faith in what you're doing.