Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-110

QueryBuilder missing values and values with wrong data types being inserted

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: None
    • Labels:
      None

      Description

      Hello,

      I'm using annotation mapping for my documents and found something strange when i insert a document (having an embed document) using the query builder...

      When i use the document class and persist it, things are fine:

      $testCase = new \Documents\Test();
      $testCase->testInt = '0';
      $testCase->intfields = new \Documents\Embed\Intfields();
      $testCase->intfields->intone = '1';
      $testCase->intfields->inttwo = '2';
      $dm->persist($testCase);
      $dm->flush();
      

      Result:
      {
      "_id": ObjectId("4d417fb1723014d009000008"),
      "testInt": 0,
      "intfields":

      { "intone": 1, "inttwo": 2 }

      }

      But when i use the query builder:

      $dm->createQueryBuilder()
      ->insert('Documents\Test')
      ->field('testInt')->set('0')
      ->field('intfields.intone')->set('1')
      ->field('intfields.inttwo')->set('2')
      ->getQuery()->execute();
      

      Result:
      {
      "_id": ObjectId("4d417fb1723014d009000009"),
      "testInt": "0",
      "intfields":

      { "inttwo": "2" }

      }

      Intone is missing and the values are all string values.

      It seems to be a bug, but as i'm new to the doctrine and mongo world, it's more than possible to be a user error. :}

      I was using the clone version of the master git hub.. is that beta2?

      Regards
      S.

      PS.: Php files are attached

        Activity

        Shards created issue -
        Hide
        Jonathan H. Wage added a comment -

        Hi, phpunit test case?

        Show
        Jonathan H. Wage added a comment - Hi, phpunit test case?
        Hide
        Jonathan H. Wage added a comment -

        This is fixed now.

        Show
        Jonathan H. Wage added a comment - This is fixed now.
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.0.0BETA2 [ 10092 ]
        Resolution Fixed [ 1 ]
        Hide
        Shards added a comment -

        thank you =}

        Show
        Shards added a comment - thank you =}
        Jonathan H. Wage made changes -
        Component/s Document Query Language [ 10058 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=MODM-110, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Shards
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: