AutoQuery with DocumentDb


I am using DocumentDb/CosmosDb as a persistence option for my Service Stack application and was wondering what would be involved in hooking this up as an AutoQuery datasource. I had a look at the AWS DynamoDb implementation, but got a little lost in the implementation details (I think my lack of familiarity with DynamoDb is making it difficult to follow the implementation in-code).

I suspect that this might be quite easy to do, since DocumentDb exposes an IOrderedQueryable<> implementation from System.Linq, but I’m not sure how to approach translating between ServiceStack’s QueryData<> implementation and IOrderedQueryable.

I have a suspicion that this might not be too difficult to implement (given the Ormlite AutoQuery implementation) but thought that it might be a good idea to open a discussion before I disappear too far down the rabbit hole…

You’d basically need to implement a QueryDataSource<T> like we’ve done with DynamoDbQueryDataSource. The AutoQueryDataTests.Dynamo test suite will also be able to help with developing a conforming implementation.

ok cool - I’ll give it a go. Is this something I can contribute back to the community? If so - what is the process/precedent?

Sure just publish it on GitHub + NuGet. Once it’s ready we’ll announce it in the release notes and can reference it in the docs like we do we’ve done with the Service Gateway Community projects,

Note: An important detail in order to have best chance of community adoption is having a well documented home page.