Skip to content

Filter for non-null values #86

Answered by swellmike
vettloffah asked this question in Help
Discussion options

You must be logged in to vote

This seems to work for me using the swell-node SDK. See examples below.

Btw, the where key is redundant. You can apply filter key/values directly. It worked for me with or without the explicit where clause.


with sku: null filter:

const result = await swell.get('/products', {
  sku: null,
  fields: ['sku'],
  limit: 3,
});

=> {
  count: 16,
  results: [
    { sku: null, id: '63c1bea94ce74f045039cb0c' },
    { sku: null, id: '63b47422187b270038d2ed9a' },
    { sku: null, id: '639bd4ff4c7aa00ff1cd5ba2' }
  ],
  page: 1,
  pages: {
    '1': { start: 1, end: 3 },
    '2': { start: 4, end: 6 },
    '3': { start: 7, end: 9 },
    '4': { start: 10, end: 12 },
    '5': { start: 13, end: 15 }
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by logeshswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants