db.[collection].find({ _id: {$gte: ObjectId(Math.floor(Date.now() / 1000) - 14 * 24 * 60 * 60)}})
postgresql
ALTER SYSTEM SET track_commit_timestamp = on;
select * from [table]
WHERE pg_xact_commit_timestamp(xmin) >= NOW() - INTERVAL '2 weeks';