jiaola / marc4js

A Node.js API for handling MARC
Apache License 2.0
39 stars 7 forks source link

Selecting a dataField with a particular tag #4

Closed librarywebchic closed 6 years ago

librarywebchic commented 6 years ago

There appears to be a way to select a particular subfield but I'm wondering if there is a way to select a datafield with a particular tag.

jiaola commented 6 years ago

For now, there is no method at the moment. You may use the code like below to find them.

    var fields = record.dataFields.filter(function (df) {
        return df.tag == '100';
    });

I'll work on creating a method to add this feature.