How to retrieve 256 items from mongodb?

I have a collection data format like this, I now transmit and _id and line. How to return 256 element array Ex: transmit _id: 4 line 1045, return line from (1045-256) to 1045

{
  "_id" : 1,
  "fingerprint" : [
    {
        "line" : 1,
        "sub_finger" : "00000000"
    },
    {
        "line" : 2,
        "sub_finger" : "00000000"
    },
    {
        "line" : 3,
        "sub_finger" : "00000000"
    },
    {
        "line" : 4,
        "sub_finger" : "00000000"
    },
    {
        "line" : 5,
        "sub_finger" : "00000000"
    }, ...


You can use the below code in with mongodb java driver.

 MongoClient client = new MongoClient("localhost", 27017);
 MongoDatabase database = client.getDatabase("test");
 MongoCollection<Document> collection = database.getCollection("collection");
 Document result = collection.find(Filters.eq("_id", 4)).projection(Projections.slice("fingerprint", 1045-256, 256)).first()