the mongodb version of sync which reads from a MongoDB buffer