basic function with leveldb