also allow `collectionOptions` to be a function - issue #109