English 中文(简体)
$7.e.eoo() MongoDB 查询中的错误
原标题:!e.eoo() error in MongoDB query

这个查询有些不对劲, 我无法辨别它是什么。 我相信它非常简单:

db.foo.insert({
     created at : new Date(),
    ooc: false,
    body:  <p>Moo</p>
 ,
    keywords: [  Moo  ],
    mentioned: [],
    tags: [],
    sender: {
        _id:  stuff ,
        name:  lambdadusk ,
         display name :  Lambda 
    }
});

我从蒙戈那里得到的错误很简单

!e.eoo()

我用的是MongoDB 2.0.5。

最佳回答

我应该早点试的

问题不在于查询, 但收藏的 BSON 数据文档因某种原因被损坏 。 我不得不放下收藏, 然后重试 。

幸运的是,收藏品是空的,因为我在早期开发。

问题回答

eoo 意指最终对象, 如果它不在那里, 您很可能在您的 JSON 中有一个分析错误 。 可能 Mongo 想要严格有效的 JSON, 所以您可能需要对所有字符串使用双引号, 或者删除新的 Date () 位 。

"http://jsonlint.com/" rel="nofollow" >http://jsonlint.com/ 表示这有效,而你张贴的代码是t.

{
    "created at": {},
    "ooc": false,
    "body": "<p>Moo</p>
",
    "keywords": [
        "Moo"
    ],
    "mentioned": [],
    "tags": [],
    "sender": {
        "_id": "stuff",
        "name": "lambdadusk",
        "displayname": "Lambda"
    }
}




相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签