Skip to content

Instantly share code, notes, and snippets.

@tonyspiro
Created October 1, 2019 21:06
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 tonyspiro/a2fc17b144f136919c03349c257bbc0b to your computer and use it in GitHub Desktop.
Save tonyspiro/a2fc17b144f136919c03349c257bbc0b to your computer and use it in GitHub Desktop.
// Get Object by Metafield Object ID
const run = async () => {
const Cosmic = require('cosmicjs')
const api = Cosmic()
const bucket = api.bucket({
slug: 'cosmic-js'
})
const data = await bucket.getObjects({
type: 'articles',
limit: 20,
metadata: {
author: '5768b253163172890e00002c'
},
props: 'slug,title'
})
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment