Q:

Google Earth Engine: Filter collection by system:index

I am trying to filter a Sentinel-2 collection by the system:index property. I have selected three specific tiles identified by its respective id, then tried filtering them from a collection using filter(ee.Filter.eq()) function, but it does not load any image. It works well for filtering only one image id, but is not working with several at the same time.
var tiles = [
  '20190129T160521_20190129T161214_T17RMN',
  '20190106T160511_20190106T160506_T17RNJ',
  '20190106T160511_20190106T160506_T17RNK'
]

var filtered = ee.ImageCollection('COPERNICUS/S2')
  .filter(ee.Filter.eq('system:index', tiles))

print(filtered.size());

https://code.earthengine.google.com/51da7be720dd9e67e9e32fa3c6fafb85?noload=true
I appreciate any help.
Best,
Luis

A:

You can simply use the ee.Filter.inList() filter:
var tiles = [
  '20190129T160521_20190129T161214_T17RMN',
  '20190106T160511_20190106T160506_T17RNJ',
  '20190106T160511_20190106T160506_T17RNK'
]

var filtered = ee.ImageCollection('COPERNICUS/S2')
  .filter(ee.Filter.inList('system:index', tiles))

print(filtered.size());

