Git Product home page Git Product logo

Comments (4)

TheCodeKing avatar TheCodeKing commented on June 18, 2024

Actually, I just realised the observed behaviour is that all items are deleted and the filter is ignored.

from keen-js.

dustinlarimer avatar dustinlarimer commented on June 18, 2024

@TheCodeKing - thanks for reporting! We'll get that syntax error fixed up. I think I've found the issue with the DELETE request as well, and will open a separate issue.

from keen-js.

dustinlarimer avatar dustinlarimer commented on June 18, 2024

@TheCodeKing this example should work properly.. apologies for the error!

import Keen from 'keen-js';

const client = new Keen({
  projectId: 'PROJECT_ID',
  masterKey: 'MASTER_KEY'
});

/*
  Filters and timeframe must be passed as encoded query string parameters. 
  This example constructs a complete URL to ensure the request is executed properly.
*/
const url = client.url('events', 'my-event-stream', {
  api_key: client.masterKey(),
  filters: encodeURIComponent(JSON.stringify([
    {
      property_name: 'user.id',
      operator: 'eq',
      property_value: 'f1243353243fdb'
    }
  ])),
  timeframe: encodeURIComponent(JSON.stringify({
    start: '2015-05-15T19:00:00.000Z',
    end: '2015-06-07T19:00:00.000Z'
  })),
  timezone: 'US/Pacific'
});

client
  .del(url)
  .send()
  .then(res => {
    // Handle response
  })
  .catch(err => {
    // Handle error
  });

from keen-js.

adamkasprowicz avatar adamkasprowicz commented on June 18, 2024

fixed in [email protected], [email protected]

from keen-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.