According to http://martinfowler.com/bliki/CQRS.html I believe getOrCreate function is an antipattern.
function getOrCreateObj(something) {
let f = find(something, db);
if (f) return f;
else return createObj(something);
}
What should I do to avoid it?