Ferreandina NoSQL stores all data in MongoDB using a document model. Unlike relational databases, there are no auto-generated ObjectId keys — every document uses an integerDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/ferreandina-nosql/llms.txt
Use this file to discover all available pages before exploring further.
_id as its primary key, managed by the application. Two collections use embedded arrays to denormalize related data for fast reads: a branches document embeds a subset of its assigned products and workers directly inside the branch document, while the canonical records for those entities live in their own top-level collections.
Embedded product and worker objects inside a
branches document are
denormalized copies kept for quick branch-level listing queries. They
carry only the fields needed for display (typically _id, name, quantity,
and image). The authoritative records — with full field sets — always live
in the products and workers collections respectively.Collection Schemas
branches
branches
The Example document (from
branches collection represents physical store locations. Each branch
document embeds a trimmed-down list of its assigned products and workers so
the UI can render a branch card in a single query.Unique integer identifier for the branch.
Human-readable branch name, e.g.
"ferreandina-manizales".City where the branch is located.
Street address of the branch.
Whether this is the main/flagship branch.
URL of the branch cover image.
Embedded array of product snapshots assigned to this branch.
Embedded array of worker snapshots assigned to this branch.
config/collections/branches.json):products
products
The Example document (from
products collection is the catalogue of all hardware items sold across
branches. Each product carries a denormalized supplier sub-document (with
_id and name) so supplier info is available without a join.Unique integer identifier for the product.
Machine-friendly product name, e.g.
"hammer" or "copper_wire_12awg".Human-readable product description.
Unit price in the store’s currency.
Foreign key (integer) referencing a document in the
categories collection.Global stock quantity (canonical value; branches may store a local copy).
Weight of a single unit in kilograms.
ISO date string when the product sold out, or
null if currently in stock.
Note: the field name contains a known typo from the source model
(sould_out_date rather than sold_out_date).Denormalized supplier snapshot.
Product image URL.
config/collections/products.json):categories
categories
The Example document:
categories collection organises products into named groups. Products
reference a category by its integer _id via the category_id field.Unique integer identifier for the category.
Category name, e.g.
"Hand Tools" or "Electrical".Short description of what types of products belong to this category.
Optional category image URL.
suppliers
suppliers
The Example document (from
suppliers collection holds the companies and individuals that supply
hardware products to Ferreandina. Supplier identity is denormalized into
product documents (and supply records) for display convenience.Unique integer identifier for the supplier.
Supplier company or individual name.
Contact email address for the supplier.
Contact phone number for the supplier.
Supplier logo or avatar image URL.
config/collections/suppliers.json):supplies
supplies
The Example document:
supplies collection records incoming stock deliveries. Each supply
document references the supplying company via a denormalized suplier
sub-document and lists the products delivered in an embedded products array.Unique integer identifier for the supply record.
Denormalized snapshot of the delivering supplier. Note: the field is spelled
suplier (one p) as defined in SupplieModel.java.List of product documents included in this delivery. Each item mirrors the
full
ProductModel schema (see the products accordion above).Number of defective units found in this delivery. Note: the field name
contains a known typo from the source model (
defective_quanity rather
than defective_quantity).ISO date string recording when the delivery was received.
customers
customers
The Example document:
customers collection stores the buyers who purchase from Ferreandina
branches. The model uses a @BsonProperty("NI") annotation to map the Java
field ni to the MongoDB field name NI (national identification number).Unique integer identifier for the customer.
National identification number for the customer. Stored under the uppercase
key
NI in MongoDB (via @BsonProperty("NI") in CustomerModel.java).Display name or alias used for the customer.
Customer category or classification (e.g. wholesale, retail).
Customer contact phone number.
workers
workers
The Example document:
workers collection stores the employees who work across Ferreandina
branches. A trimmed version of each worker document (only _id, name, and
image) is embedded inside the corresponding branch document.Unique integer identifier for the worker.
Worker’s full name.
Worker photo URL.
Worker’s age in years.
Job speciality or role description (e.g.
"electrician", "plumber").Worker’s body weight in kilograms (used for safety/equipment assignments).
Worker’s contact email address.
Worker’s contact phone number.
Worker’s monthly salary.
Relationships
Ferreandina NoSQL uses a hybrid approach that mixes MongoDB-style denormalization with relational-style integer foreign keys. Reference by integer ID (category_id → categories._id)
: Products carry a category_id field that is an integer matching _id in the categories collection. This is a classic foreign-key reference; the application must issue a second query (or use $lookup in an aggregation pipeline) to resolve the full category document.
Denormalized supplier reference (supplier._id inside products)
: Rather than referencing suppliers by ID alone, each product embeds a supplier sub-document with { "_id": ..., "name": ... }. This avoids a second round-trip when displaying product listings, but means supplier name changes must be propagated to all embedded copies.
Embedded arrays in branches (products / workers)
: Branch documents embed trimmed snapshots of their assigned products and workers. The embedded copies contain only the fields needed for display; full records remain in the products and workers collections. This pattern optimises branch-listing queries at the cost of write amplification whenever a product’s name, quantity, or image changes.