HF RL Explorer

Task: Implement Conditional Array Element Addition in MongoDB

Task: Implement Conditional Array Element Addition in MongoDB: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script using PyMongo that adds a new document to an embedded array in MongoDB only if no existing element in the array matches on a specific key field ( name ), regardless of…

The task

Write a Python script using PyMongo that adds a new document to an embedded array in MongoDB only if no existing element in the array matches on a specific key field (`name`), regardless of other fields (`options`).

Part of PrimeIntellect/Terminal-Lego-15k.