How can I delete FileDataMeasurements?

#1

How can I delete FileDataMeasurements matching a filter? say
Filter.eq('parent.id', 'WellsRV_Auxillary_Pump_Speed--W_086e2d75')

I observed there is a method on FileDataMeasurement named removeIndexed but I am not sure if I can achieve what I need with it.

0 Likes

#2

/**

  • Removes multiple instances of a C3 type based on a filter expression. When possible the remove will be
  • accomplished with multi-row DELETE statements at the SQL level. When that is not possible, the remove is
  • processed row by row (using batching). In that case the operation may take a very long time for a large data set.
  • If archiving is enabled, the instances will not be physically removed. Instead they will be serialized to XML and
  • saved in the archive table for the type. Archived entries can be recovered by calling the {@link unremove}
  • function.
  • @param removeFilter
  •    Filter to specify which instances are to be removed.  Valid filter expressions follow the same rules as in
    
  •    {@link FetchSpec.filter}.  If not specified, all instances will be removed.
    
  • @param allowMultiRowProcessing
  •    When true, if the operation can be handled via multi-row SQL operations it will.  If false, or the operation
    
  •    can't be handled with multi-row SQL operations (e.g. invalidation requirements), then objs will be
    
  •    fetched/batched and used to call removeBatch.  Default is false.
    
  • @param disableAsyncProcessing
  •    Disables any downstream asynchronous processing that would happen as a result of the operation (e.g. calc
    
  •    fields).  This should only be specified when absolutely necessary and when the result of doing so is
    
  •    completely understood.  If you don't know, DON'T USE IT.
    
  • @return the number of objs removed.
    */
    @action(group=‘delete’)
    removeAll: function(removeFilter: string, allowMultiRowProcessing: boolean, disableAsyncProcessing: boolean): int

Be very careful to include the filter or it will remove everything in the type.

0 Likes

#3

The methods remove and removeAll are unavailable on FileDataMeasurement

0 Likes

#4

Can you file a ticket? Having a removeAll on FileData makes sense

0 Likes

#5

Bumping this thread!

Without remove, FileDataMeasurements are difficult to test with Jasmine. TestApi attempts to assign an id field when using createEntity or createBatchEntity, which returns:

C3Error: Extraneous property "id" on object type "FileDataMeasurement". [MakeValidationError]

It can be created outside the TestApi scope, but then a remove method is required.

0 Likes

#6

There is an open ticket to add this api, but in the meanwhile you can remove it using:

S3.deleteFiles(FileDataMeasurement.rawDataEndPoint(‘WellsRV_Auxillary_Pump_Speed’), true)

0 Likes