Closed dxgi closed 1 year ago
I will think about the benefits of returning the document itself as for now im focusing on finishing the search functionality.
About nested objects, they should already be supported everywhere (even on search), if the problem is whithin the types not showing them, then i made a mistake when i was remaking them. About supporting array of objects im still searching for possible solutions, curretly the problem is that i havent found a way to implement it properly on RediSearch without some hacky solution (like creating a new key for them)
Alright, Looking forward to this! :D
After some thought i will not implement this since it can lead to data not being in sync with the database, however i will allow the create
method to accept an object with the data just like createAndSave
so it is more intuitive to work.
I think the model.createAndSave method should at least return the Document.
The model and document should be able to handle nested objects, and array of nested objects.
This is how I implemented mine: https://github.com/dxgi/typesafe https://github.com/dxgi/typesafe/blob/master/src/test/index.ts