Skip to content

Instantly share code, notes, and snippets.

@JohnAllen
Created June 6, 2021 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnAllen/6fe2f1f55addadd154387afb6390ce97 to your computer and use it in GitHub Desktop.
Save JohnAllen/6fe2f1f55addadd154387afb6390ce97 to your computer and use it in GitHub Desktop.
const admin = require("firebase-admin") // required
const projectId = "lingo-e9b0f"
admin.initializeApp({ projectId })
const db = admin.firestore()
async function getMarker() {
let count = 0;
const snapshot = await admin.firestore().collection('sentence-pairs').get()
const less = snapshot.docs.map(async doc => {
const sent = {id: doc.id, ...doc.data()}
if (!sent.tgtLeastFreq) {
const res = await db.collection('sentence-pairs').doc(sent.id).delete();
}
})
}
getMarker()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment