Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StORMRow does not contain id #2

Open
truemetal opened this issue Mar 22, 2017 · 0 comments
Open

StORMRow does not contain id #2

truemetal opened this issue Mar 22, 2017 · 0 comments

Comments

@truemetal
Copy link

truemetal commented Mar 22, 2017

Here, in this function if I call this.id() it would return 0, while in db there's something like "_id" : ObjectId("58d29558a54d7552e223dae3")

override func to(_ this: StORMRow) {
  id = this.id() as? String ?? ""
}

Although it can be elicited manually from data:

id = (this.data["_id"] as? Dictionary<String,String> ?? [:])["$oid"] ?? ""
po this.data["_id"]
▿ Optional<Any>
  ▿ some : 1 element
    ▿ 0 : 2 elements
      - .0 : "$oid"
      - .1 : "58d29558a54d7552e223dae3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant