在mongoDb中查找->查找行为异常

时间:2019-01-24 02:31:28

标签: node.js mongodb

不起作用:

void RunAnim(Color disableColor, Color backgroundColor, bool disable)
{
    new Animation
    {
        { 0, 1, new Animation (v => view1.Opacity = v, disable ? 1 : 0, disable ? 0 : 1) },
        { 0, 1, new Animation (v => view1.TranslationX = v,  disable ? 0 : -view1.Width, disable ? -view1.Width : 0) },
        { 0, 1, new Animation (v => view2.TranslationX = v, disable ? view1.Width : 0, disable ? 0 : view1.Width) },
        { 0, 1, new Animation (v => view2.Opacity = v, disable ? 0 : 1, disable ? 1 : 0) },
    }.Commit(this, "viewAnim", 16, 1000, Easing.CubicInOut, (v, c) =>
    {
        physicalButton.IsEnabled = !disable;
        physicalButton.BackgroundColor = disableColor;
        networkButton.IsEnabled = disable;
        networkButton.BackgroundColor = backgroundColor;
    });
}

void Physical_Clicked(object sender, EventArgs e)
{
    var disableColor = Color.Navy;
    var backgroundColor = Color.Transparent;
    var disable = true;

    RunAnim(disableColor, backgroundColor, disable);
}

void Network_Clicked(object sender, EventArgs e)
{
    var disableColor = Color.Transparent;
    var backgroundColor = Color.Navy;
    var disable = false;

    RunAnim(disableColor, backgroundColor, disable);
}

作品:

Locations.find({ query: { _id: apartment.location }}).then(result=>result[0]);

作品:

Locations.find({ Fake: { _id: apartment.location }}).then(result=>result[0]);

不知道为什么会这样。

P.S。 _id是db中的“字符串”,不是ObjectId。

0 个答案:

没有答案