We will at first get all the different noStereoID and make a unique list using something like
const collections = [];
const targetCollection = 'bestofCompounds';
const uniqueIDs = {};
for (let i = 0; i < collections.length; i++) {
// fetch all noStereoID from the DB
for (let id of ids) {
uniqueIDs[id] = true;
}
}
let array = Object.keys(uniqueIDs);
for (let id of array) {
// retrieve all the info in all the collections
// join the information in a smart way ;)
// add mf, em using OCL.Molecule.fromIdCode and then getMF https://github.com/cheminfo/docker-pubchem/blob/de2e577531484e0c8f6fb24ae008a1d0e0e6330e/pubchem/src/plugins/compounds/sync/utils/improveCompound.js#L50-L56
// save in the new targetCollection
}
Get inspired by mfs / aggreates.
We will at first get all the different noStereoID and make a unique list using something like