Document-oriented database framework