pofider / node-simple-odata-server

Simple OData server for node.js
MIT License
97 stars 60 forks source link

Sub Level Complex Type values are stored, but unable to retrieve #53

Open krakzk opened 1 year ago

krakzk commented 1 year ago

Have used the library to create odata service. Create an Entity 'UserType' with a Complex Type 'Address' which has a sub complex type 'Location'. The data gets saved in the db. But when i run the command to fetch, the Location always comesempty.

{
            "_id": "640f052702b849252f020415",
            "test": "joe",
            "num": "55",
            "addresses": {
                "street": "101-Main",
                "location": [
                    {}
                ]
            }
        }

The data in DB :

{
  "_id": "640f052702b849252f020415",
  "test": "joe",
  "num": "55",
  "addresses": {
    "street": "101-Main",
    "location": [
      {
        "country": "UK",
        "continent": "Europe"
      }
    ]
  }
}

Query i used: {my url}/UserType?$expand=AddressType/Location