#pragma once #include #include #include namespace smartbotic::database { /** * Apply view projection (include/exclude) to a document. * * Semantics: * - include non-empty: only those paths are kept (exclude ignored) * - include empty, exclude non-empty: all fields except excluded paths * - both empty: document returned unchanged * * Paths use dot notation: "user.profile.name". Stops at arrays. * Missing intermediate paths are silently skipped. * * Metadata fields (_id, _version, _created_at, _updated_at, _created_by, _updated_by) * are always preserved regardless of include/exclude. */ nlohmann::json applyProjection(const nlohmann::json& document, const std::vector& include, const std::vector& exclude); } // namespace smartbotic::database