Type error, field len does not exist in type [Entry]

Hey everyone! What type the Entry should be here to use the .len()?

Error: Type error, field len does not exist in type [Entry]
My code:

import Types "./types";
import Array "mo:base/Array";
import Principal "mo:base/Principal";

type Entry = Types.Entry;     
 
 var entries: [Entry] = [];
 
 public query func listEntries(max: Nat): async [Entry] {
        var m = max;
         if (entries.len() == 0) {
             return [];         };
        if (m > entries.len()) {
            m := entries.len();
        };

};

Hi Thanasis

.len() was changed to .size(), so you can use entries.size() now.

It was changed for consistency with other modules.

2 Likes