Q:

How to query mutiple nodes by ID, Firebase Realtime Database

So I had an object like this coming from firebase realtime database
  "3e97a0918fc5429ca470e017a9ff0b04": {
    "bearing": 0,
    "latitude": "19.9737038",
    "longitude": "73.7897944",
    "timestamp": "1557027317083",
    "trip": "3e97a0918fc5429ca470e017a9ff0b04",
    "user": "1346"
  },
  "43efa340444d454cb2673b9afd95c810": {
    "bearing": 329,
    "latitude": "20.1597784",
    "longitude": "73.8792233",
    "timestamp": "1554784486880",
    "trip": "43efa340444d454cb2673b9afd95c810",
    "user": "1339"
  },
  "4d1118279bd14597a59feaf883c1a1a4": {
    "bearing": 227,
    "latitude": "20.1588567",
    "longitude": "73.8851554",
    "timestamp": "1554681994097",
    "trip": "4d1118279bd14597a59feaf883c1a1a4",
    "user": "1467"
  },
  "4e28d129df8d4e399e094fd85f9891a0": {
    "bearing": 0,
    "latitude": "20.1450097",
    "longitude": "73.8935804",
    "timestamp": "1554940195655",
    "trip": "4e28d129df8d4e399e094fd85f9891a0",
    "user": "1488"
  },
  "584427ae15f240c896c13058e41a69b5": {
    "bearing": 177,
    "latitude": "20.1595356",
    "longitude": "73.8792819",
    "timestamp": "1554521339710",
    "trip": "584427ae15f240c896c13058e41a69b5",
    "user": "1316"
  },
  "5a4c13ed54584541b5da1fe6dc4d4405": {
    "bearing": 0,
    "latitude": "20.1597879",
    "longitude": "73.8792057",
    "timestamp": "1554523562777",
    "trip": "5a4c13ed54584541b5da1fe6dc4d4405",
    "user": "1511"
  },
}

But I want to only track trips with particular IDS. My Question is how do I limit the nodes by providing particular ids?
Let say I only wanted trips with ids
3e97a0918fc5429ca470e017a9ff0b04
43efa340444d454cb2673b9afd95c810
I tried using the equalTo method but that returns a single trip. And i also tried using orderByChild("trip") but that doesnt help either since the trips are uuids.

A:

You write in your question that you want "to track trips". If you want to declare a listener for only a certain list of database nodes (i.e. trips) in order to listen to their changes (i.e. "tracking" them), you will need to call the on() method for each node.
Something like the following would do the trick:
  var database = firebase.database();
  var idsToListenTo = ["3e97a0918fc5429ca470e017a9ff0b04", "3e97a0918fc5429ca470e017a9ff0b04"];

  idsToListenTo.forEach(id => {
        database.ref(id).on('value', snapshot => {
            console.log("trip " + snapshot.key + " has just changed");
            console.log(snapshot.val());
        });
    }
  );

