schema for mongo and function defs