TEST(QueryProjectionTest, AssignmentToDottedPathRequiresFirstComponent) {
    auto proj = createProjection("{}", "{_id: 0, 'a.b': {$add: [5, 3]}}");
    ASSERT_FALSE(proj.isSimple());
    ASSERT_FALSE(proj.requiresDocument());

    const auto& fields = proj.getRequiredFields();
    ASSERT_EQ(fields.size(), 1);
    ASSERT_EQ(fields[0], "a");
}
TEST(QueryProjectionTest, AssignmentToDottedPathRequiresFirstComponent) {
    auto proj = createProjection("{}", "{_id: 0, 'a.b': {$add: [5, 3]}}");
    ASSERT_FALSE(proj.isSimple());
    ASSERT_FALSE(proj.requiresDocument());

    const auto& fields = proj.getRequiredFields();
    ASSERT_EQ(fields.size(), 1);
    ASSERT_EQ(fields[0], "a");
}