Registry / database / mongolike-operations

mongolike-operations

JSON →
library0.1.5jsnpmunverified

Provides Flow type definitions for MongoDB-like query and update operations (FindOperation, UpdateOperation, QueryCondition, etc.) used in the Phenyl framework. Version 0.1.5 is the latest stable release. Part of the Phenyl family (unmaintained since ~2018), it defines operations as data (OAD) for handling large JSON. Not actively maintained; used internally by Phenyl modules.

npm install mongolike-operations
INSTALL
IMPORT
SIG · MONGOLIKE-OPERATIO
M
mongolike-operations
databasejavascriptv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FindOperation
import type { FindOperation } from 'mongolike-operations'
const { FindOperation } = require('mongolike-operations')
Flow type-only library; runtime import will be undefined. Use import type for TypeScript.
UpdateOperation
import type { UpdateOperation } from 'mongolike-operations'
import { UpdateOperation } from 'mongolike-operations'
Type-only import. CommonJS require yields empty object.
QueryCondition
import type { QueryCondition } from 'mongolike-operations'
Only exported as a Flow type; cannot be used as a value.

Shows how to import and use FindOperation and UpdateOperation types in a Flow/TypeScript project.

// @flow import type { FindOperation, UpdateOperation } from 'mongolike-operations'; const findOp: FindOperation = { $and: [ { name: 'phenyl' }, { version: { $gte: 1 } } ] }; const updateOp: UpdateOperation = { $set: { 'details.status': 'active' }, $inc: { count: 1 } }; // Use these types in your Phenyl-based application.
Debug
Known issues
deprecatedPackage is unmaintained since 2018; no updates for 6+ years.
fix
Use MongoDB driver types or custom type definitions instead.
affects: >=0.0.0
gotchaFlow-only types; not exported as runtime values. Importing as values yields undefined.
fix
Use `import type` for Flow or TypeScript; avoid `require()` or `import` without `type`.
affects: >=0.0.0
breakingType definitions may not be fully compatible with MongoDB 4.0+ operators (e.g., $expr not supported).
fix
Extend types for newer operators or switch to official MongoDB types.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'mongolike-operations' require
require('mongolike-operations') returns an empty object because only types are exported.
fix
Use `import type { ... } from 'mongolike-operations'` instead of require.
TypeError: mongolike_operations is not a function
Attempting to call an exported type as a function.
fix
Types cannot be used as values. Only use them for type annotations.
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mongolike-operations — npm install mongolike-operations · libregistry