This code snippet appears to be related to MongoDB syntax, specifically in the context of a Meteor app:
const { selectedSectionId } = this.state;
const assignmentsSelector = {
formativeId: this.props.formative._id,
$or: [{ public: true }],
};
if (selectedSectionId && selectedSectionId !== 'all') {
assignmentsSelector.$or.push({ sectionId: selectedSectionId });
}
Can you explain the purpose and function of the $or
in the code above?