🎉 svc-infra v1.0 is here — Production-ready backend infrastructure
What's new
nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
svc-infra / API Reference

NoSqlResource

from svc_infra.db.nosql.resource import NoSqlResource
View source
svc_infra.db.nosql.resource

Mongo resource declaration used by API & CLI. Define indexes here (either IndexModel or simple alias dicts).

Constructor
NoSqlResource(collection: str | None = None, prefix: str = '', document_model: type[Any] | None = None, read_schema: type[Any] | None = None, create_schema: type[Any] | None = None, update_schema: type[Any] | None = None, search_fields: Sequence[str] | None = None, tags: list[str] | None = None, id_field: str = '_id', soft_delete: bool = False, soft_delete_field: str = 'deleted_at', soft_delete_flag_field: str | None = None, service_factory: Callable[[Any], Any] | None = None, read_name: str | None = None, create_name: str | None = None, update_name: str | None = None, create_exclude: tuple[str, ...] = ('_id',), read_exclude: tuple[str, ...] = (), update_exclude: tuple[str, ...] = (), indexes: Iterable[IndexModel | IndexAlias] | None = None) -> None
ParameterTypeDefaultDescription
collectionstr|NoneNone—
prefixstr''—
document_modeltype[Any] |NoneNone—
read_schematype[Any] |NoneNone—
create_schematype[Any] |NoneNone—
update_schematype[Any] |NoneNone—
search_fieldsSequence[str] |NoneNone—
tagslist[str] |NoneNone—
id_fieldstr'_id'—
soft_deleteboolFalse—
soft_delete_fieldstr'deleted_at'—
soft_delete_flag_fieldstr|NoneNone—
service_factoryCallable[[Any], Any] |NoneNone—
read_namestr|NoneNone—
create_namestr|NoneNone—
update_namestr|NoneNone—
create_excludetuple[str, ...]('_id',)—
read_excludetuple[str, ...]()—
update_excludetuple[str, ...]()—
indexesIterable[IndexModel | IndexAlias] |NoneNone—

Methods

On This Page

Constructorresolved_collection