UNPKG

@kitapp-developers/mongo-import-export

Version:

A modern CLI tool to import/export MongoDB collections to and from JSON or CSV — great for backups, migrations, and local development.

7 lines (6 loc) 215 B
export function isValidObjectId(str) { return /^[0-9a-fA-F]{24}$/.test(str); } export function isValidDate(str) { return /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/.test(str) && !isNaN(Date.parse(str)); }